Upgrade to Pro — share decks privately, control downloads, hide ads and more …

leçon n°139, API Platform ce n'est que pour du POC, FAUX !

leçon n°139, API Platform ce n'est que pour du POC, FAUX !

La première chose qui est mise en avant avec API Platform c'est la capacité de faire du développement rapide d'application. C'est vrai. Ça ne signifie pas pour autant qu'il est impossible de réaliser une application complexe avec une séparation de la couche métier, de l'api publique. Voyons ensemble les mécanismes avancés d'API Platform et les outils qui en feront votre framework API en PHP.

Grégoire Hébert

March 29, 2019
Tweet

More Decks by Grégoire Hébert

Other Decks in Programming

Transcript

  1. @gheb_dev Grégoire Hébert ‣Senior Developper & Trainer @ Les-Tilleuls.coop ‣CEO

    of MasterClass by Les-Tilleuls.coop @gheb_dev @gregoirehebert
  2. @gheb_dev LvL 0: Always the same URL in POST with

    a 200 return status code. POST: /api
  3. @gheb_dev LvL 1: Each type of data has its own

    URL. POST: /books POST: /customers
  4. @gheb_dev LvL 2: We use specific verbs for specific actions

    with status codes according to the result. GET: /books POST: /books PUT: /books/12
  5. @gheb_dev LvL 3: Hateoas - Hypermedia As The Engine Of

    Application State. We add links to describe how to get to the information in the answer. { "@context": { "comments": "http://api.example.com/vocab#comments" }, "@id": "http://api.example.com/an-issue", "title": "An exemplary issue linking to its comments", "comments": { "@id": "http://api.example.com/an-issue/comments" } }
  6. @gheb_dev V1 - DunglasJsonLdApiBundle Mars 2015 Juin 2015 Dedicated Website

    Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available
  7. @gheb_dev Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available

    January 2017 V2 Stable Available V2.2 February 2018
  8. @gheb_dev Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available

    January 2017 V2 Stable Available V2.2 February 2018
  9. @gheb_dev Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available

    January 2017 V2 Stable Available V2.2 February 2018
  10. @gheb_dev Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available

    January 2017 V2 Stable Available V2.2 February 2018
  11. @gheb_dev Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available

    January 2017 V2 Stable Available February 2018 V2.2 March 2019 V2.4
  12. @gheb_dev Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available

    January 2017 V2 Stable Available February 2018 V2.2 February 2019 V2.4
  13. @gheb_dev Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available

    January 2017 V2 Stable Available February 2018 V2.2 February 2019 V2.4
  14. @gheb_dev Septembre 2015 V2 Announced Mai 2016 V2 Alpha Available

    January 2017 V2 Stable Available February 2018 V2.2 March 2019 V2.4
  15. @gheb_dev Any Public, Protected, Private property will be accessible through

    your API 
 As long as you define the means to access it ! THANKS TO… ?
  16. @gheb_dev What if I want to set/remove ownership right after

    the change of state 
 with API Platform?
  17. @gheb_dev Don’t forget to leverage the power of the Symfony

    components you use. They are highly tested !
  18. @gheb_dev Create a resource Output is set to false, nothing

    to do We need to create the transformers
  19. @gheb_dev THANK YOU ! I am so thirsty right now…

    But if you’ve got any question :)