Skip to content

Improper handling of BinaryMediaTypes property #1036

@keetonian

Description

@keetonian

Description:

After doing additional verification work with the BinaryMediaTypes property and the fix implemented in #954, I found that the fix still contains an issue.

The BinaryMediaTypes property requires encoded values, so image/gif should be passed to this property as image~1gif.

The x-amazon-apigateway-binary-media-types swagger property cannot read the encoded value, and so the values should be passed to it as image/gif.

Steps to reproduce the issue:

  1. Deploy an API with a binary media type in encoded format
  2. Verify API deployed correctly
  3. Deploy API again, updating BMT section with an additional media type
  4. Verify that the new media type is deployed correctly, but the old type (sometimes) is switched from using a / to using the encoded value (~1) which is incorrect.

Fix: replace ~1 with / for x-amazon-apigateway-binary-media-types property.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions