-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Binary media types bug fix #1043
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1043 +/- ##
===========================================
+ Coverage 94.82% 94.82% +<.01%
===========================================
Files 69 69
Lines 3244 3248 +4
Branches 632 632
===========================================
+ Hits 3076 3080 +4
Misses 87 87
Partials 81 81
Continue to review full report at Codecov.
|
@@ -257,7 +258,8 @@ def add_cors(self, path, allowed_origins, allowed_headers=None, allowed_methods= | |||
allow_credentials) | |||
|
|||
def add_binary_media_types(self, binary_media_types): | |||
self._doc[self._X_APIGW_BINARY_MEDIA_TYPES] = binary_media_types | |||
bmt = json.loads(json.dumps(binary_media_types).replace('~1', '/')) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dump it into json so all nested lists and dictionaries are expressed as a string, replace the ~1
with /
, and then load back into data form.
c6cd846
to
9a67613
Compare
Issue #, if available:
#1036
Description of changes:
Converts
~1
to/
, as is expected in the swagger for binary media types.The CloudFormation property expects
~1
. Docs: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html#cfn-apigateway-restapi-binarymediatypesThe Swagger property expects
/
. Docs: https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-swagger-extensions-binary-media-types.htmlDescription of how you validated changes:
Tests updated and pass.
Checklist:
make pr
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.