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
* implement sparse fieldsets
* make hash conversions work with Ruby 1.9.x
* remove ruby-head and add 2.3.1 to run specs with on Travis
* post-review fixes
* allow also to pass specific fields as array instead of comma-separates values
* add docs
* Readme post-review fixes
This option overrides the `jsonapi_serializer_class_name` method.
418
419
420
+
### Sparse fieldsets
421
+
422
+
The JSON:API spec allows to return only [specific fields](http://jsonapi.org/format/#fetching-sparse-fieldsets).
423
+
424
+
For example, if you wanted to return only `title` and `author` fields for `posts` type and `name` field for `users` type, you could write the following code:
You can easily specify relationships with the `has_one` and `has_many` directives.
@@ -783,7 +840,6 @@ See [Releases](https://github.com/fotinakis/jsonapi-serializers/releases).
783
840
784
841
## Unfinished business
785
842
786
-
* Support for the `fields` spec is planned, would love a PR contribution for this.
787
843
* Support for pagination/sorting is unlikely to be supported because it would likely involve coupling to ActiveRecord, but please open an issue if you have ideas of how to support this generically.
0 commit comments