0.0.2 • Published 3 years ago

@carlsberg/openapi-aws-extensions v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

OpenAPI AWS API Gateway Extensions

A library and CLI that add API Gateway extensions to OpenAPI specification files

Disclaimer

This project is work in progress and isn't production ready, it doesn't support all API Gateway extensions for OpenAPI and lacks customization features. Use at your discretion.

Installation

To install the CLI tool:

$ npm install --global @carlsberg/openapi-aws-extensions-cli
$ openapi-aws-extensions-cli --version
0.0.1

To install the library to use on your project:

$ npm install --save @carlsberggbs/openapi-aws-extensions

Usage

$ openapi-aws-extensions-cli --help

Usage: openapi-aws-extensions-cli -w [num] -h [num]

Options:
  --help                Show help                                      [boolean]
  --version             Show version number                            [boolean]
  --inputFile           The OpenAPI specification file to add extensions to
                                                             [string] [required]
  --outputFile          The file to output the resulting OpenAPI specification
                                                                        [string]
  --outputFormat        The output format (either JSON or YAML), if different
                        from input                    [string] [default: "yaml"]
  --lambdaFunctionName  The AWS Lambda Function name to use on the extension's
                        URI                                  [string] [required]
  --cors                Enable CORS                   [boolean] [default: false]

Options

NameDescriptionDefault
inputFileThe path to the OpenAPI specification file to which to add AWS extensionsnull
outputFileThe path to where to output the extended OpenAPI specification. If none is specified, the result is outputted to stdoutnull
outputFormatThe format of the outputted OpenAPI specificationyaml or inputFile format
lambdaFunctionNameAn AWS Lambda Function name to use in the x-amazon-apigateway-integration extensionnull
corsAdds default CORS headers to any OPTIONS methods to enable CORSfalse

Reference