module:ResponseValidator

new module:ResponseValidator()

ResponseValidator
Properties
NameTypeDescription
responseDefinitionArray.<Object>openapi responses definition
shouldEnforcebooleanwhether to throw or silently fail on invalid response

Members

definition :object

OpenAPI definition for responses
Type:
  • object

shouldEnforce :boolean

whether to throw or silently fail on invalid response
Type:
  • boolean

Methods

test(statusCode, contentType, body) → {ResponseError|boolean}

test an outgoing response against the current instance of ResponseValidator
Parameters:
NameTypeDescription
statusCodestringresponse status code
contentTypestringresponse content type
bodyobjectresponse body
Returns:
Type: 
ResponseError | boolean