Class SpecRestApi

java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
All Implemented Interfaces:
IConstruct, IDependable, IResource, IRestApi, software.amazon.jsii.JsiiSerializable, 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.

Example:

 Integration integration;
 SpecRestApi api = SpecRestApi.Builder.create(this, "books-api")
         .apiDefinition(ApiDefinition.fromAsset("path-to-file.json"))
         .build();
 Resource booksResource = api.root.addResource("books");
 booksResource.addMethod("GET", integration);
 
  • Constructor Details

    • SpecRestApi

      protected SpecRestApi(software.amazon.jsii.JsiiObjectRef objRef)
    • SpecRestApi

      protected SpecRestApi(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • SpecRestApi

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