RestApiMode Enum
The Mode that determines how API Gateway handles resource updates when importing an OpenAPI definition.
| Source | aws-apigateway/lib/restapi.ts |
|---|---|
| Type last changed |
Example
ts
const api = new apigateway.SpecRestApi(this, 'books-api', {
apiDefinition: apigateway.ApiDefinition.fromAsset('path-to-file.json'),
mode: apigateway.RestApiMode.MERGE
});
python
api = apigateway.SpecRestApi(self, "books-api",
api_definition=apigateway.ApiDefinition.from_asset("path-to-file.json"),
mode=apigateway.RestApiMode.MERGE
)
java
SpecRestApi api = SpecRestApi.Builder.create(this, "books-api")
.apiDefinition(ApiDefinition.fromAsset("path-to-file.json"))
.mode(RestApiMode.MERGE)
.build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
var api = new SpecRestApi(this, "books-api", new SpecRestApiProps {
ApiDefinition = ApiDefinition.FromAsset("path-to-file.json"),
Mode = RestApiMode.MERGE
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
api := apigateway.NewSpecRestApi(this, jsii.String("books-api"), &SpecRestApiProps{
ApiDefinition: apigateway.ApiDefinition_FromAsset(jsii.String("path-to-file.json")),
Mode: apigateway.RestApiMode_MERGE,
})
Members
| Member | Description |
|---|---|
OVERWRITE | The new API definition replaces the existing one. |
MERGE | The new API definition is merged with the existing API. |
Referenced by
SpecRestApiProps.modemodemodeModeMode