Class RestApi<PATHS, OPS>

Type Parameters

  • PATHS

  • OPS

Hierarchy

Constructors

Properties

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

Type declaration

api: SpecRestApi
apiSpec: OpenAPI3
node: Node

The tree node.

Stability

stable

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

  • 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'

    See

    https://swagger.io/docs/specification/authentication/

    Parameters

    • spec: OpenAPI3

    Returns void

  • Parameters

    • method: string

    Returns boolean

  • Returns a string representation of this construct.

    Stability

    stable

    Returns string

  • (deprecated) Checks if x is a construct.

    Returns

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

    Deprecated

    use x instanceof Construct instead

    Parameters

    • x: any

      Any object.

    Returns x is Construct

Generated using TypeDoc