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
JSON API Client is a PHP Library to validate and handle the response body from a [JSON API](http://jsonapi.org) Server.
9
+
JsonApiClient is a PHP Library to validate and handle the response body from a [JSON API](http://jsonapi.org) Server.
10
10
11
11
Format: [JSON API 1.0](http://jsonapi.org/format/1.0/)
12
12
13
+
#### Attention
14
+
15
+
Version 0.5 and below interprets the pagination links wrong. Make sure you are using the latest version of JsonApiClient. See [issue #19](https://github.com/Art4/json-api-client/issues/19) for more information.
16
+
13
17
### WIP: Goals for 1.0
14
18
15
19
*[x] Be 100% JSON API 1.0 spec conform
@@ -35,15 +39,15 @@ See the [documentation](docs/README.md).
35
39
36
40
```php
37
41
// The Response body from a JSON API server
38
-
$jsonapi_string = '{"meta":{"info":"Testing the JSON API Client."}}';
42
+
$jsonapi_string = '{"meta":{"info":"Testing the JsonApiClient Library."}}';
39
43
40
44
$manager = new \Art4\JsonApiClient\Utils\Manager();
41
45
42
46
$document = $manager->parse($jsonapi_string);
43
47
44
48
if ($document->has('meta.info'))
45
49
{
46
-
echo $document->get('meta.info'); // "Testing the JSON API Client."
50
+
echo $document->get('meta.info'); // "Testing the JsonApiClient Library."
47
51
}
48
52
49
53
// List all keys
@@ -56,7 +60,7 @@ var_dump($document->getKeys());
56
60
57
61
### Using as validator
58
62
59
-
JSON API Client can be used as a validator for JSON API contents:
63
+
JsonApiClient can be used as a validator for JSON API contents:
60
64
61
65
```php
62
66
$wrong_jsonapi = '{"data":{},"meta":{"info":"This is wrong JSON API. `data` has to be `null` or containing at least `type` and `id`."}}';
@@ -75,7 +79,7 @@ else
75
79
76
80
### Extend the client
77
81
78
-
Need more functionality? Want to directly inject your model? Easily extend the client with the [Factory](docs/utils-factory.md).
82
+
Need more functionality? Want to directly inject your model? Easily extend JsonApiClient with the [Factory](docs/utils-factory.md).
0 commit comments