Re:FastAPI – Easily create robust, standardized API endpoint...
by rubiquity on Monday July 28, 2014 @02:04PM
(#8098370)
Why would I use this over ActiveModel::Serializers?
[ Parent
| on HN ]
Re:FastAPI – Easily create robust, standardized API endpoint...
by keithwhor on Monday July 28, 2014 @02:29PM
(#8098515)
The goal of this project is for easy model accession / querying via JavaScript or some other external interface. The most powerful part of this implementation, I would argue, is the filtering of endpoint data via request.query_parameters.
This allows for "people/?age__gte=25" and other simple logic filters that can be communicated over the HTTP request, and is standard across all models and endpoints.
Re:FastAPI – Easily create robust, standardized API endpoint...
by jerhinesmith on Monday July 28, 2014 @02:34PM
(#8098535)
Couldn't you easily accomplish the same thing via the ransack gem?
https://github.com/activerecord-hackery/ransack/wiki/Basic-S...
Re:FastAPI – Easily create robust, standardized API endpoint...
by keithwhor on Monday July 28, 2014 @02:40PM
(#8098576)
Yes, I'm sure you could --- in combination with ActiveModel::Serializer.
Our approach was meant to attack a combination of common, specific problems (standardized way to output API data, queryable with logic via HTTP parameters, a single SQL query to collect and aggregate data) with a dead simple, low-overhead solution.