From 838351af0654361377fab6aa9008e11595874ed9 Mon Sep 17 00:00:00 2001 From: Juan Treminio <50673996+jtreminio-dropbox@users.noreply.github.com> Date: Thu, 1 Aug 2024 14:50:45 -0500 Subject: [PATCH] Release 1.4.2 (#11) --- README.md | 4 +-- VERSION | 2 +- dropbox_sign/__init__.py | 2 +- dropbox_sign/api_client.py | 10 ++++--- dropbox_sign/configuration.py | 2 +- openapi-config.yaml | 2 +- setup.py | 2 +- templates/api_client.mustache | 8 +++--- tests/test_signature_request_api.py | 42 +++++++++++++++++++++++++++++ 9 files changed, 60 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index e0d344f..c716660 100644 --- a/README.md +++ b/README.md @@ -50,7 +50,7 @@ Python >=3.7 Install using `pip`: ```shell -python3 -m pip install dropbox-sign==1.4.1 +python3 -m pip install dropbox-sign==1.4.2 ``` Alternatively: @@ -362,6 +362,6 @@ apisupport@hellosign.com This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 3.0.0 -- Package version: 1.4.1 +- Package version: 1.4.2 - Build package: org.openapitools.codegen.languages.PythonClientCodegen diff --git a/VERSION b/VERSION index 347f583..9df886c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.1 +1.4.2 diff --git a/dropbox_sign/__init__.py b/dropbox_sign/__init__.py index d6d3b83..53e65f3 100644 --- a/dropbox_sign/__init__.py +++ b/dropbox_sign/__init__.py @@ -11,7 +11,7 @@ """ -__version__ = "1.4.1" +__version__ = "1.4.2" # import ApiClient from dropbox_sign.api_client import ApiClient diff --git a/dropbox_sign/api_client.py b/dropbox_sign/api_client.py index c5efb4c..3ccd0ef 100644 --- a/dropbox_sign/api_client.py +++ b/dropbox_sign/api_client.py @@ -77,7 +77,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.4.1/python' + self.user_agent = 'OpenAPI-Generator/1.4.2/python' def __enter__(self): return self @@ -780,10 +780,12 @@ def __gather_params(self, kwargs): if len(remove_files): for param in body: - param_value_full = (param, json.dumps(body[param])) + param_value_full = (param, body[param]) + # do not change non-JSON values - if not '{' in param_value_full[1] and not '[' in param_value_full[1]: - param_value_full = (param, body[param]) + if (not isinstance(body[param], (str, bool, int, float))): + param_value_full = (param, json.dumps(body[param])) + params['form'].append(param_value_full) else: params['body'] = param_value diff --git a/dropbox_sign/configuration.py b/dropbox_sign/configuration.py index 9abe4a0..6c49dbf 100644 --- a/dropbox_sign/configuration.py +++ b/dropbox_sign/configuration.py @@ -413,7 +413,7 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 3.0.0\n"\ - "SDK Package Version: 1.4.1".\ + "SDK Package Version: 1.4.2".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self): diff --git a/openapi-config.yaml b/openapi-config.yaml index 2ad0908..5d0e404 100644 --- a/openapi-config.yaml +++ b/openapi-config.yaml @@ -4,7 +4,7 @@ additionalProperties: generatorLanguageVersion: ">=3.7" packageName: dropbox_sign projectName: dropbox-sign - packageVersion: 1.4.1 + packageVersion: 1.4.2 sortModelPropertiesByRequiredFlag: true legacyDiscriminatorBehavior: true packageAuthor: Dropbox Sign API Team diff --git a/setup.py b/setup.py index 1735ebf..039dc5b 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from pathlib import Path NAME = "dropbox-sign" -VERSION = "1.4.1" +VERSION = "1.4.2" # To install the library, run the following # # python setup.py install diff --git a/templates/api_client.mustache b/templates/api_client.mustache index 486d840..4891673 100644 --- a/templates/api_client.mustache +++ b/templates/api_client.mustache @@ -800,10 +800,12 @@ class Endpoint(object): if len(remove_files): for param in body: - param_value_full = (param, json.dumps(body[param])) + param_value_full = (param, body[param]) + # do not change non-JSON values - if not '{' in param_value_full[1] and not '[' in param_value_full[1]: - param_value_full = (param, body[param]) + if (not isinstance(body[param], (str, bool, int, float))): + param_value_full = (param, json.dumps(body[param])) + params['form'].append(param_value_full) else: params['body'] = param_value diff --git a/tests/test_signature_request_api.py b/tests/test_signature_request_api.py index c52c789..1146f35 100644 --- a/tests/test_signature_request_api.py +++ b/tests/test_signature_request_api.py @@ -73,6 +73,48 @@ def test_init_allows_binary_file(self): obj.files[0].close() + def test_init_allows_jsony_chars_in_strings(self): + title = "테스트 - testing japanese characters in subject" + subject = "[テスト]" + message = "{\"テスト - testing message\"}" + + request_data = { + "test_mode": True, + "title": title, + "subject": subject, + "message": message, + "signers": [ + { + "email_address": "jill@example.com", + "name": "Jill", + "order": 1 + } + ], + "files": [open(get_base_path() + "/../test_fixtures/pdf-sample.pdf", "rb")] + } + + obj = m.SignatureRequestSendRequest.init(request_data) + + self.mock_pool.expect_request( + content_type='multipart/form-data', + data=request_data, + response={} + ) + + self.api.signature_request_send(obj) + + fields = self.mock_pool.get_fields() + + title_result = fields[1] + subject_result = fields[2] + message_result = fields[3] + + self.assertEqual(title_result[1], title) + self.assertEqual(subject_result[1], subject) + self.assertEqual(message_result[1], message) + + obj.files[0].close() + def test_signature_request_bulk_create_embedded_with_template(self): request_class = 'SignatureRequestBulkCreateEmbeddedWithTemplateRequest' request_data = get_fixture_data(request_class)['default']