UML / API : How to model a RESTful API

Fatimaezzahra Rarhibou picture Fatimaezzahra Rarhibou · May 15, 2017 · Viewed 23.5k times · Source

I need to create a UML class diagram and a use case diagram for a RESTFul API that I developed using API Platform and Symfony 3.2 (backend) and Ionic 2 (frontend). But i dont exactly know how to describe the structure of my backend API through the class diagram.

If anyone has any idea or could be of any help, i'd truly appreciate it. Thank you!

Answer

Fatimaezzahra Rarhibou picture Fatimaezzahra Rarhibou · May 17, 2017

So the solution to my problem was a bit of all of the following :

https://www.ibm.com/developerworks/rational/library/design-implement-restful-web-services/ : I concluded from this that, although it's difficult to model a restful api in a class diagram (since it's basically just a bunch of methods), consider the classes like "Resources", add the methods (basically the HTTP methods), and the paths to each resource.

This was also of huge help:

Another (simpler) way was to use tools like Pikturr, which transform your Swagger into a UML diagram.

Softwares for designing REST APIs :

  • Visual Paradigm
  • IBM Rational Software Architect

I hope this helps.