Class SpecRestApi

All Implemented Interfaces:
IConstruct, IDependable, IResource, IRestApi,, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:45.089Z") @Stability(Stable) public class SpecRestApi extends RestApiBase
Represents a REST API in Amazon API Gateway, created with an OpenAPI specification.

Some properties normally accessible on @see RestApi - such as the description - must be declared in the specification. All Resources and Methods need to be defined as part of the OpenAPI specification file, and cannot be added via the CDK. By default, the API will automatically be deployed and accessible from a public endpoint.


 Integration integration;
 SpecRestApi api = SpecRestApi.Builder.create(this, "books-api")
 Resource booksResource = api.root.addResource("books");
 booksResource.addMethod("GET", integration);
  • Constructor Details

    • SpecRestApi

      protected SpecRestApi( objRef)
    • SpecRestApi

      protected SpecRestApi( initializationMode)
    • SpecRestApi

      @Stability(Stable) public SpecRestApi(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull SpecRestApiProps props)
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details