From 551a4185c04d8a2bf236a3b46de6174c46bfb085 Mon Sep 17 00:00:00 2001 From: bszabo Date: Wed, 20 Dec 2023 15:25:14 -0500 Subject: [PATCH] Bszabo/tnl 11327 file upload (#257) * feat: bszabo/TNL-11327-multipart MIME Set multipart/form-data MIME type to be binary to support file uploads through the API Gateway * feat: TNL-11327 fix syntax for media type config --- scripts/aws/common/deploy.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/aws/common/deploy.py b/scripts/aws/common/deploy.py index 8185207..407fa89 100755 --- a/scripts/aws/common/deploy.py +++ b/scripts/aws/common/deploy.py @@ -60,7 +60,12 @@ def deploy_api(client, rest_api_id, swagger_filename, stage_name, stage_variable swagger = open(swagger_filename, 'r', encoding="utf-8") # pylint: disable=consider-using-with - api_response = client.put_rest_api(restApiId=rest_api_id, mode='overwrite', body=swagger.read()) + api_response = client.put_rest_api( + restApiId=rest_api_id, + mode='overwrite', + body=swagger.read(), + parameters={'binaryMediaTypes': 'multipart/form-data'}, # This MIME needs to be binary for file uploads + ) logging.info('Existing API ID "%s" updated (name "%s")', api_response['id'], api_response['name']) deployment_response = client.create_deployment(