Skip to content

Latest commit

 

History

History
159 lines (73 loc) · 2.48 KB

File metadata and controls

159 lines (73 loc) · 2.48 KB

Home > @codemonger-io/cdk-rest-api-with-spec > RestApiWithSpec

RestApiWithSpec class

This API is provided as a beta preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

CDK construct that provisions an API Gateway REST API endpoint and also synthesizes the OpenAPI definition for it.

Signature:

export declare class RestApiWithSpec extends apigateway.RestApi implements IRestApiWithSpec 

Extends: apigateway.RestApi

Implements: IRestApiWithSpec

Remarks

NOTE: Please turn on the validation of CDK stacks. If you skip the validation of CDK stacks, this construct cannot synthesize the OpenAPI definition. Because this construct utilizes the validation as a trigger to start synthesis.

Constructors

Constructor

Modifiers

Description

(constructor)(scope, id, props)

(BETA) Initializes a REST API with the OpenAPI specification.

Properties

Property

Modifiers

Type

Description

props

readonly

RestApiWithSpecProps

(BETA)

root

readonly

IResourceWithSpec

(BETA) Root resource with the OpenAPI definition.

Methods

Method

Modifiers

Description

addModel(id, props)

(BETA) Returns the addModel function augmented with the features to build the OpenAPI definition.