aws/aws-cdk

apigateway: add binaryMediaTypes property to SpecRestApi construct

已關閉

#35,498 建立於 2025年9月15日

 (1 則留言) (0 個反應) (0 位負責人)TypeScript (3,530 個分叉)batch import
@aws-cdk/aws-apigatewayeffort/mediumfeature-requestgood first issuep2

倉庫指標

星標
 (10,710 顆星)
PR 合併指標
 (平均合併 14天 11小時) (30 天內合併 68 個 PR)

描述

Describe the feature

The SpecRestApi construct should accept as one of his construct props a binaryMediaTypes property that is the list of binary media mime-types that are supported by the resource.

This is already supported by the RestApi construct and by the underlying CloudFormation resource:

Use Case

When the API Gateway have to return binary data the mime-type has to be added in the API Gateway settings via the BinaryMediaTypes property.

Proposed Solution

Add the binaryMediaTypes to the SpecRestApi construct

Other Information

At the moment the alternative solution is to use escape hatches: https://docs.aws.amazon.com/cdk/v2/guide/cfn-layer.html

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

AWS CDK Library version (aws-cdk-lib)

2.213.0

AWS CDK CLI version

2.174.1

Environment details (OS name and version, etc.)

Linux

貢獻者指南