module:Endpoint

new module:Endpoint(securitySchemes, securityCallbacks, definition, controllerFunc, enforceResponseValidation)

Endpoint constructor
Parameters:
NameTypeDescription
securitySchemesArray.<Object>openapi top-level security definition
securityCallbacksMap.<string, function()>matching security definition validators
definitionobjectopenapi endpoint definition
controllerFuncMap.<string, function()>matching endpoint controller function
enforceResponseValidationbooleanflag for failing invalid responses (that don't match the endpoint's responseScheme)

Methods

(async) testIncoming(path, headers, queryParams, contentType, bodyParams)

Test request against the endpoint input validators
Parameters:
NameTypeDescription
pathMap.<string, any>path parameters object
headersMap.<string, any>header parameters object
queryParamsMap.<string, any>query string parameters object
contentTypestringcontent type of the input
bodyParamsMap.<string, any>body

(async) testOutgoing(statusCode, contentType, responseBody) → {Promise.<(ResponseError|boolean)>}

Test response against the endpoint output validators
Parameters:
NameTypeDescription
statusCodestringresponse status code
contentTypestringresponse content type
responseBodyobjectresponse body
Returns:
Type: 
Promise.<(ResponseError|boolean)>