API and serialization

← API and serialization

Ashterix

docs(articles): Magento and Symfony examples side by side, request lifecycle as a Mermaid diagram

en/articles/magento-to-symfony/data/api.md +6 −1

2 2
3 3 Magento generates REST and SOAP from service interfaces. In Symfony there are two paths: regular controllers with the Serializer for an API you control, or API Platform when you need CRUD, filters, pagination and OpenAPI quickly from an attribute on the entity.
4 4
5 + ::::columns
6 + :::col
5 7 **Magento** · webapi.xml
6 8
7 9 ```xml
13 15 </resources>
14 16 </route>
15 17 ```
16 −
18 + :::
19 + :::col
17 20 **Symfony** · controller + serialization groups
18 21
19 22 ```php
36 39 ]);
37 40 }
38 41 ```
42 + :::
43 + ::::
39 44
40 45 **Symfony** · API Platform: the closest thing to autogeneration
41 46