Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony Form vs. Serializer for RESTful API

Should I use Form component or Serializer component to bind request data to domain object for a RESTful API project?

I feel that Form is difficult to customize and not naturally fit with RESTful.

Some guys use Serializer for object binding instead of Form. Eg: http://www.slideshare.net/dlondero/rest-in-practiceenglish

like image 631
Kevin Avatar asked Sep 02 '25 04:09

Kevin


1 Answers

After over a year, I suggest anyone working with RESTful Web Services in Symfony should use Serialize Component instead of Form Component because of customization and simplicity.

With Serializer Component you can easily customize request format, error message...

like image 146
Kevin Avatar answered Sep 04 '25 23:09

Kevin