Daniel S. W.
Daniel S. W.

Reputation: 51

Strategies for making FOS RestBundle and json HAL integratable in RESTful apis

What would be good strategies/approaches to integrate the HAL specification with the FOSRestBundle?

A rather simple approach would be to create a plain PHP entity to represent HAL in its entirety, and then send the object back with each response. Although this can work quite well, I think it should be integrated with listeners. That would require some thinking, and potentially the topics below would have to be covered:

Upvotes: 2

Views: 3376

Answers (3)

seltzlab
seltzlab

Reputation: 340

Take a look at http://www.apigility.org by ZF2 team. Apigility serves in JSON HAL format. Here is a nice article on how to integrate a Symfony2 app with Apigility: http://www.zimuel.it/create-api-symfony2-apigility

Upvotes: 1

William Durand
William Durand

Reputation: 5519

You will probably love the Hateoas library, and its Symfony2 bundle: BazingaHateoasBundle.

Upvotes: 5

virhi
virhi

Reputation: 203

If you whant to implement Hal specification, there is a bundle for that alterway/RestHalBundle. You do not need to implement it in FOSRestBundle.

And for error handling : alterway / RestProblemBundle

Upvotes: 1

Related Questions