Reputation: 51
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
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
Reputation: 5519
You will probably love the Hateoas library, and its Symfony2 bundle: BazingaHateoasBundle.
Upvotes: 5
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