nilportugues / php-json-api

JSON API transformer outputting valid (PSR-7) API Responses.
http://nilportugues.com
MIT License
71 stars 35 forks source link

Allow pagination and meta for all serializers #27

Closed nilportugues closed 9 years ago

nilportugues commented 9 years ago

Actually only JSONAPI and HALJSON serializer are meant to support these, but JSON could support it too by adding a meta attribute holding these.

$serializer->setSelfUrl('http://example.com/posts/9');
$serializer->setNextUrl('http://example.com/posts/10');
$serializer->addMeta(
  'author',
  [
    ['name' => 'Nil Portugués Calderó', 'email' => 'contact@nilportugues.com']
  ]
);
nilportugues commented 9 years ago

Fixed in https://github.com/nilportugues/json-api-transformers/commit/43dbe7db29caa567369ecf94e6d1ce0900afb47c