Module: JSONAPI::Response
- Defined in:
- lib/easy/jsonapi/response.rb
Overview
Used to validate the serialized response before returned to a client
Class Method Summary collapse
-
.validate(headers, body) ⇒ Nilclass
If no errors are found.
Class Method Details
.validate(headers, body) ⇒ Nilclass
Returns if no errors are found.
15 16 17 18 19 20 |
# File 'lib/easy/jsonapi/response.rb', line 15 def self.validate(headers, body) # TODO: Spec checks based on collections which can be refered from the location header # returned by the server JSONAPI::Exceptions::HeadersExceptions.check_compliance(headers.transform_keys(&:to_s).transform_keys(&:upcase)) JSONAPI::Exceptions::DocumentExceptions.check_compliance(body) end |