We like the familiar way Active Model Serializers lets us declare our serializers. Declaration syntax of fast_jsonapi is similar to AMS.
class MovieSerializer
include FastJsonapi::ObjectSerializer
attributes :name, :year
has_many :actors
belongs_to :owner, record_type: :user
belongs_to :movie_type
end
How fast is it compared to Active Model Serializers?
Performance tests indicate a 25–40x speed gain over AMS, essentially making serialization time negligible on even fairly complex models. Performance gain is significant when the number of serialized records increases.
Difference in performance
Don’t believe us? You can run the benchmark tests for yourself. Refer toreadme.
Dependency
JSON API is the anti-bikeshedding tool.
Future Work
We plan to add more features to the gem. We welcome suggestions, improvements, corrections and additional tests.