You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This returns a [Document](objects-document.md) object which provided all contents.
19
19
20
20
> **Note:** If `$jsonapi_string` contains not valid JSON or JSON API a [Exception\ValidationException](exception-introduction.md#exceptionvalidationexception) will be thrown.
21
+
>
22
+
> See more about Exceptions in the [Exception section](exception-introduction.md).
21
23
22
24
### Validate a JSON API response body
23
25
24
-
JSON API Client can be used as a validator. It will throw an [Exception\ValidationException](exception-introduction.md#exceptionvalidationexception) if the body contains not valid JSON or JSON API.
26
+
JSON API Client can be used as a validator:
25
27
26
28
```php
27
29
$wrong_jsonapi = '{"data":{},"meta":{"info":"This is wrong JSON API. `data` has to be `null` or containing at least `type` and `id`."}}';
28
30
29
-
try
31
+
if ( \Art4\JsonApiClient\Utils\Helper::isValid($wrong_jsonapi) )
0 commit comments