fast_jsonapi
fast_jsonapi copied to clipboard
#serialized_json for empty collection
Hi,
Behavior for serializer passed empty collection is to return nil
I think it would make more sense for the serializer to return []. Ideally would work with empty Array and empty Relation.
##### Current behavior
UserSerializer.new([]).serialized_json
=> nil
##### Desired behavior(?)
UserSerializer.new(User.where.not(id: nil)).serialized_json
=> "[]"
https://github.com/Netflix/fast_jsonapi/issues/462