new module:ResponseValidator()
ResponseValidator
PropertiesName | Type | Description |
---|---|---|
responseDefinition | Array.<Object> | openapi responses definition |
shouldEnforce | boolean | whether to throw or silently fail on invalid response |
- Source
- See
- https://swagger.io/docs/specification/describing-responses/ - for responseDefinition
Members
definition :object
OpenAPI definition for responses
Type:
- object
- Source
- See
- https://swagger.io/docs/specification/describing-responses/ - for responseDefinition
shouldEnforce :boolean
whether to throw or silently fail on invalid response
Type:
- boolean
- Source
Methods
test(statusCode, contentType, body) → {ResponseError|boolean}
test an outgoing response against the current instance of ResponseValidator
Parameters:
Name | Type | Description |
---|---|---|
statusCode | string | response status code |
contentType | string | response content type |
body | object | response body |
- Source
Returns:
- Type:
- ResponseError |
boolean