Subresources, the easy way with API Platform 3
summary
Shows how API Platform 3 replaces fragile APISubresource hacks with explicit scoped operations (uriTemplate + uriVariables + Link) so /teams/{teamId}/players returns scoped IRIs and avoids order-dependent behavior via itemUriTemplate. Demonstrates NotExposed operations for REST-required but hidden endpoints, an experimental CreateProvider that injects parent resources into POST bodies (POST /teams/{teamId}/injuries), using a dedicated /seats endpoint to fix N+1, and the uriTemplate on APIProperty plus canonical_uri_template and 3xx redirection to normalize alternate resource URIs.
AI-written summary · about
chapters (10)
- 0:00Introduction to sub-resources
- 2:55Listing team players
- 6:15Defining resource relations
- 7:22Evolution of API platform
- 9:11New operation design
- 15:04Nested sub-resources
- 18:29The N+1 problem
- 22:04Posting nested data
- 26:44Over-fetching data
- 30:57Redirection and conclusion








