Building first-class REST APIs with Symfony
summary
Concrete recipe for working REST APIs using Symfony components: use DTO parameter converter to hydrate typed inputs, centralize validation as exceptions and render JSON via an overridden exception controller, serialize output with Fractal transformers, and consider API Platform for boilerplate. Watch HTTP verbs and codes (misused GETs can delete data), avoid heavy COUNTs that made a query take 30s, and prefer constants over magic numbers. Tools and patterns reduce controller bloat and actually work.
AI-written summary · about
chapters (22)
- 0:00Start
- 1:11WHAT IS REST?
- 1:58REPRESENTATIONAL STATE TRANSFER
- 9:59HTTP RESPONSE CODES
- 10:35HTTP VERBS
- 14:43ERRORS
- 23:12VALIDATION
- 24:28REMOVE CONTROL FROM CONTROLLERS
- 25:50SYMFONY SERIALIZER COMPONENT
- 26:24TRANFORMERS
- 30:42PAGINATION AND LINKS
- 33:15DISABLING A TOTAL CAN MAKE THINGS QUICKER
- 34:23PAGERFANTA
- 34:38FRACTAL INTEGRATION
- 35:22GETTING IT TO YOUR REPOSITORY
- 35:51SORTS AND FILTERS
- 36:08THERE'S AN OBJECT FOR THAT
- 38:58TOOLS
- 39:19API PLATFORM
- 39:39DEMO
- 43:35RECAP
- 45:30ANY QUESTIONS?
related talks
41mBuilding first-class REST APIs with Symfony
39mBuilding RESTful APIs with Symfony Components
50mBuild RESTful APIs easily with Symfony
41mBuilding Restful APIs with Symfony Components
53mHigh Quality APIs with API Platform
38mDeveloping APIs with Symfony in 2023
34mSymfony and Elasticsearch: debugging and optimizations
34mWhy PHP and Symfony are still in the game
