Class RestApi<PATHS, OPS>

Type Parameters

  • PATHS

  • OPS

Hierarchy

Constructors

Properties

_functions: {
    [operationId: string]: LambdaFunction;
} = {}

Type declaration

api: SpecRestApi
apiDomainName?: string
apiFQDN?: string
apiHostName?: string
apiSpec: OpenAPI3
hostedZone?: IHostedZone
node: Node

The tree node.

props: RestApiProps<OPS>

Methods

  • Parameters

    • operation: OperationObject
    • method: string
    • description: string
    • additionalLambdaOptions: LambdaOptions = {}

    Returns undefined | LambdaFunction

  • Type Parameters

    • P extends string | number | symbol

    Parameters

    • path: P
    • method: keyof PATHS[P]

    Returns undefined | LambdaFunction

  • Parameters

    • spec: {
          [key: string]: any;
      }
      • [key: string]: any

    Returns {
        [key: string]: any;
    }

    • [key: string]: any
  • return the generated Lambda function for the specified API operation

    Parameters

    • operationId: keyof OPS

    Returns LambdaFunction

  • Visitor method to modify the given functions

    Parameters

    • operationIds: (keyof OPS)[]

      the list of functions to visit

    • op: ((fn) => void)

      the function to call for every function

    Returns void

  • AWS does not properly apply the 'security' option to every single path-method. According to documentation, global security gets applied, if there is no security set for the particular path-method. If there is any, even empty, it will get precedence. THIS DOES NOT HAPPEN ON AWS. IT JUST ALWAYS USES THE GLOBAL SETTING!

    'security applies [...] schemes globally to all API operations, unless overridden on the operation level'

    Parameters

    • spec: OpenAPI3

    Returns void

  • Parameters

    • method: string

    Returns boolean

  • Returns a string representation of this construct.

    Returns string

  • Checks if x is a construct.

    Use this method instead of instanceof to properly detect Construct instances, even when the construct library is symlinked.

    Explanation: in JavaScript, multiple copies of the constructs library on disk are seen as independent, completely different libraries. As a consequence, the class Construct in each copy of the constructs library is seen as a different class, and an instance of one class will not test as instanceof the other class. npm install will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the constructs library can be accidentally installed, and instanceof will behave unpredictably. It is safest to avoid using instanceof, and using this type-testing method instead.

    Parameters

    • x: any

      Any object

    Returns x is Construct

    true if x is an object created from a class which extends Construct.

Generated using TypeDoc