Releases: tiagopog/jsonapi-utils
Support for Rails 5
Major features:
- Update of
jsonapi-resources
tov0.8.0
; - Support for Rails 5;
- Support for custom filters and custom paginators;
- Support for dasherized and camelized format keys.
Major bug fixes:
- Fix double request parsing for default actions;
- Use the proper key format for filter and sort operations.
Pair features from 0.4.x and 0.5.x
Major features included:
- Custom filters;
- Custom paginators;
- Support for dasherized and camelized format keys.
Add support to Rails 5 and JSONAPI::Resources 0.8.0.beta1
This version introduces a couple of breaking changes to JSONAPI::Utils
mostly because Rails 5 changed the way it deals with request parameters.
Main updates:
- Add support to Rails 5;
- Add support to
JSONAPI::Resources
at version0.8.0.beta1
; - It no longer needs to inherit
JSONAPI::Resources
directly in controllers, onlyJSONAPI::Utils
is required; - Lots of code refactoring.
Introduce helpers for params
Improvements
- Add helper methods to easily get permitted params for the primary resource and its relationships:
resource_params
: helper to get the permitted params fromparams['data']['attributes']
;relationship_params
: helper to getid
s fromparams['relationships']
.
Fixes
- Work with a copy of ActionController's params in JSONAPI::Utils::Request#setup_request to avoid the bug reported in #21.
More details: #23
Introduce error rendering
This release brings a lot of improvements in terms of dealing with error messages. The major feature is the introduce of jsonapi_render_errors
which renders a proper error response for any object which implements the #errors
method.
Fix request validation flow
- Fix an issue with the flow of request setup and validation reported in #12.
General improvements and fixes
- Update README with some features from v0.4.1 and v0.4.2;
- Improve the way it renders a Hash or a collection of Hashes;
- Turn
JSONAPI::Utils#filter_params
andJSONAPI::Utils#sort_params
into accessible helpers for getting deserialized filter/sort params from query string; - Not found error responses now supports slugs and uuids;
- Better support for errors generated by requests which are not compliant with JSON API's specs.
Add some features from v0.3.5
There was a parallel development for v0.3.x because of its compatibility with jsonapi-resources
at the popular versions v0.5.x . Then some features like a proper sorting and filtering, improvements for pagination, record count and other were firstly released for v0.3.5. Now v0.4.2 brings all those features for projects heading to use the latest version of jsonapi-resources
.
Now supporting:
- Filter:
- Filter records via
filter
query string param; - Add filter opt-out:
jsonapi_render collection, options: { filter: false }
; - Access filter params via:
filter_params
in controllers.
- Filter records via
- Sort:
- Sort records via
sort
query string param; - Sorting is possible for two kind of objects:
ActiveRecord_Relation
andArray
; - Access sort params via:
sort_params
in controllers.
- Sort records via
- Pagination:
- Pagination is possible for two kind of objects:
ActiveRecord_Relation
andArray
; - Add pagination opt-out:
jsonapi_render collection, options: { paginate: false }
.
- Pagination is possible for two kind of objects:
General fixes and improvements:
- Exception handling;
- Pagination count;
- Capturing the ID of a not found record.
Add support to filter and sort
Now supporting:
- Filter:
- Filter records via
filter
query string param; - Options to avoid filtering:
jsonapi_render collection, options: { filter: false }
; - Access filter params via:
filter_params
in controllers.
- Filter records via
- Sort:
- Sort records via
sort
query string param; - Sort is possible for two kind of objects:
ActiveRecord_Relation
andArray
; - Access sort params via:
sort_params
in controllers.
- Sort records via
- Pagination for
ActiveRecord_Relation
andArray
objects.
Fixes:
- Exception handling;
- Pagination count.