-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API GatewaybugThis issue is a bug.This issue is a bug.p2
Description
The documentation states about defaultIntegration:
An integration to use as a default for all methods created within this API unless an integration is specified.
Yet when I define an API with no integration defined within the OpenAPI spec, the default integration is ignored and an error occurs when deploying.
Reproduction Steps
SpecRestApi openapiRestApi = SpecRestApi.Builder.create(this, "MyApi")
.restApiName("MyApi")
.apiDefinition(ApiDefinition.fromAsset("openapi.yaml"))
.defaultIntegration(LambdaIntegration.Builder.create(myLambda)
.proxy(false)
.build())
.deploy(true)
.build();
where myLambda is a lambda defined earlier in the CDK.
The OpenApi spec has a single method defined (the header and model are not shown):
paths:
/items:
get:
summary: List all items.
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/ItemList'
Error Log
The following error appears in the CloudFormation events when deploying:
No integration defined for method (Service: AmazonApiGateway; Status Code: 400; Error Code: BadRequestException; Request ID: 56113150-1460-4ed2-93b9-a12618864582)
Environment
- CLI Version : 1.42.0
- Framework Version: 1.42.1
- Node.js Version: v12.16.0
- OS : Windows
- Language (Version): Java
Other
This is 🐛 Bug Report
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
@aws-cdk/aws-apigatewayRelated to Amazon API GatewayRelated to Amazon API GatewaybugThis issue is a bug.This issue is a bug.p2