new module:Endpoint(securitySchemes, securityCallbacks, definition, controllerFunc, enforceResponseValidation)
Endpoint constructor
Parameters:
Name | Type | Description |
---|---|---|
securitySchemes | Array.<Object> | openapi top-level security definition |
securityCallbacks | Map.<string, function()> | matching security definition validators |
definition | object | openapi endpoint definition |
controllerFunc | Map.<string, function()> | matching endpoint controller function |
enforceResponseValidation | boolean | flag for failing invalid responses (that don't match the endpoint's responseScheme) |
- Source
Methods
(async) testIncoming(path, headers, queryParams, contentType, bodyParams)
Test request against the endpoint input validators
Parameters:
Name | Type | Description |
---|---|---|
path | Map.<string, any> | path parameters object |
headers | Map.<string, any> | header parameters object |
queryParams | Map.<string, any> | query string parameters object |
contentType | string | content type of the input |
bodyParams | Map.<string, any> | body |
- Source
(async) testOutgoing(statusCode, contentType, responseBody) → {Promise.<(ResponseError|boolean)>}
Test response against the endpoint output validators
Parameters:
Name | Type | Description |
---|---|---|
statusCode | string | response status code |
contentType | string | response content type |
responseBody | object | response body |
- Source
Returns:
- Type:
- Promise.<(ResponseError|boolean)>