index

main file
Source:

Members

(inner) responseMiddlewareHasBeenApplied

Source:
used make sure the *order* of which the middlewares are applied is correct The `response` middleware MUST be applied FIRST, before the `request` middleware is applied. We'll use this to make sure the order is correct. If not - we'll throw an informative error.

(inner) swaggerUiServePath

Source:

Methods

(inner) getMethod(req) → {Object|undefined}

Source:
Parameters:
Name Type Description
req
Returns:
Type
Object | undefined

(inner) getPathKey(req) → {string|undefined|*}

Source:
Parameters:
Name Type Description
req
Returns:
Type
string | undefined | *

(inner) getSpec() → {Object}

Source:
Returns:
Type
Object

(inner) handleRequests()

Source:
apply the `request` middleware Applies to the `app` you provided in `handleResponses` Also, since this is the last function you'll need to invoke, it also initializes the specification and serves the api documentation. The options are for these tasks.
Returns:
void

(inner) handleResponses(expressApp, optionsopt)

Source:
apply the `response` middleware.
Parameters:
Name Type Attributes Description
expressApp Express the express app
options Object <optional>
optional configuration options
Properties
Name Type Attributes Default Description
specOutputPath string | undefined <optional>
where to write the openAPI specification to. Specify this to create the openAPI specification file.
writeIntervalMs number <optional>
10000 how often to write the openAPI specification to file
Returns:
void

(inner) init(aApp, aPredefinedSpecopt, aSpecOutputPathopt, aWriteIntervalopt, aSwaggerUiServePathopt)

Source:
initialize the `express-oas-api`. This will apply both `handleResponses` and `handleRequests` and also will call `serveApiDocs`.
Parameters:
Name Type Attributes Default Description
aApp Express the express app
aPredefinedSpec * <optional>
{}
aSpecOutputPath string | undefined <optional>
where to write the openAPI specification to. Specify this to create the openAPI specification file.
aWriteInterval number <optional>
10000 how often to write the openAPI specification to file
aSwaggerUiServePath string <optional>
api-docs where to serve the openAPI docs. Defaults to `api-docs`

(inner) patchSpec(predefinedSpec) → {Object}

Source:
Parameters:
Name Type Description
predefinedSpec
Returns:
Type
Object

(inner) serveApiDocs()

Source:
serve the openAPI docs with swagger at a specified path / url
Returns:
void

(inner) setPackageInfoPath(pkgInfoPath)

Source:
Parameters:
Name Type Description
pkgInfoPath path to package.json

(inner) updateSchemesAndHost(req)

Source:
Parameters:
Name Type Description
req

(inner) updateSpecFromPackage()

Source: