Building first-class REST APIs with Symfony
summary
Shows how to build REST APIs with Symfony components using DTOs via ParamConverter to keep controllers under five lines, an overrideable exception controller that returns structured JSON errors (use 201, 422/validation payloads, 429 rate-limit), and Fractal transformers for output plus link-aware pagination. Demonstrates repository-based filtering/sorting, a "disable total" query trick to avoid expensive counts, and recommends API Platform or the FOS-style bundle when wanting autogenerated routes, docs and formats.
AI-written summary · about
chapters (9)
- 0:00Introduction and speaker intro
- 1:50What is REST and its principles
- 10:00Using HTTP verbs and response codes correctly
- 13:56Consistent error handling in APIs
- 17:34Data Transfer Objects and parameter converters
- 24:46Formatting API output with transformers
- 29:23Pagination and hypermedia links
- 36:47Tools for building REST APIs
- 39:36Recap and key takeaways
related talks
57mBuilding first-class REST APIs with Symfony
41mBuilding Restful APIs with Symfony Components
39mBuilding RESTful APIs with Symfony Components
50mBuild RESTful APIs easily with Symfony
53mHigh Quality APIs with API Platform
34mWhy PHP and Symfony are still in the game
39mSuitable serialization with API Platform and Symfony
56mREST or GraphQL? Examples with Symfony and API Platform
