Update router so it knows how to handle response schemas for non json
responses.
@@ -531,6 +531,11 @@ class Router(object):
try:
validator = CustomValidator(response_spec['schema'], resolver=self.spec_resolver)
+
+ response_type = response_spec['schema'].get('type', 'json')
+ if response_type == 'string':
+ validator.validate(resp.body)
+ else:
validator.validate(resp.json)
except (jsonschema.ValidationError, ValueError):
LOG.exception('Response validation failed.')
