~/talk

Building Restful APIs with Symfony Components

Talkat PHP UK Conference 2017 · 2017-02-16..02-17· [php, web-platform]
speakerdeck:victoriaq
slides:none on file

Shows how five Symfony components—HTTP Foundation, Serializer, Validator, Form and Guard—combine to build REST APIs, with concrete demos: returning 201 on POST, group-based JSON views, max-depth to avoid circular refs, and a simple JWT auth flow that actually issues tokens. Mentions JMS Serializer, FOSRestBundle and Nelmio for docs, uses SQLite fixtures with Alice/Faker and PHPUnit functional tests, and gives migration patterns for incrementally replacing legacy code while the API works.

AI-written summary · about

  1. 0:00Intro
  2. 0:511. INTRODUCTION
  3. 2:36Sane way to approach REST
  4. 6:05What are Symfony Components
  5. 7:41II. SYMFONY COMPONENTS
  6. 8:57Let's create a POST endpoint
  7. 10:00Symfony PSR-7 Bridge
  8. 12:15Deserializing
  9. 14:49Annotations
  10. 15:30Let's create a GET endpoint
  11. 16:00Creating your custom normalizers
  12. 17:04Simplest example
  13. 17:39Validating objects
  14. 17:58Constraints
  15. 19:29Let's create a PUT endpoint
  16. 23:39Components and bundles
  17. 24:05JMSSerializerBundle
  18. 25:14FOSRestBundle
  19. 26:00LexikJWTAuthenticationBundle
  20. 29:02IV. TESTING
  21. 30:38Error handling - Nested errors
  22. 31:08Error handling - HTML errors
  23. 31:42Testing, some tips
  24. 32:24Fixtures with Alice & Faker
  25. 33:17Migrations - Option 1
  26. 35:09Summarizing
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.