Fast, Testable and SANE APIs
summary
Covers adopting the JSON API spec for compound documents, side‑loading and sparse fieldsets, and using rails-api to strip middleware so Rails runs fewer layers of Ruby for speed. Recommends active_model_serializers for conventional JSON output, notes built‑in caching was removed and needs careful handling, and explains conditional GETs with ETag/Last‑Modified to avoid work. Tests use rack‑test to assert status codes and serialized contracts; versioning must be additive to remain compatible.
AI-written summary · about
chapters (11)
- 0:00Introduction and context
- 4:37API design principles
- 6:21JSON API standards
- 8:51Anecdotal intermission
- 10:23Advanced JSON API features
- 12:51HTTP semantics and consistency
- 14:33Optimizing Rails for APIs
- 18:05Micro-framework considerations
- 20:28Active Model Serializers
- 24:52Caching and performance
- 27:26Testing and conclusions
related talks
35mBuilding Ambitious APIs with Ruby
42mBuilding Better Web APIs with Rails
25mJSON API
38mDesigning a Great Ruby API - How We're Simplifying Rails 5
33mUniformity ain't all bad getting consistent behavior across your API
28mTesting HTTP APIs in Ruby
45mThe illusion of stable APIs
42mWeb API's with ERLANG a Ruby Dev's POV
