Sylius/Sylius — pull request #1698 by pjedrzejewski (2014-07-05 22:12:29+00:00)
Title: [WIP] Implement JSON API

Hey there Sylius folks!

We have prepared pretty much everything for API, thanks to all contributors!

I took Shipping Categories as an example, cause they are pretty simple. I decided that for the sake of speed, we should use Symfony WebTestCase (with little modifications) instead of Behat, simply because we would need to optimize our features suite in the first place and this could delay the API even more.

PHPUnit is pretty fast here and I figured out a nice way to do it through TDD and write response patterns.

I have used Alice for the API fixtures, quite simple and efficient to write and php-matcher for these nice JSON patterns, which allows us to first write how the response should look and then implement it.

If you agree this is the best way for us right now, I'd polish this and add other resources in another PRs to keep this one simple. I will work now on one more complex example, with more relations etc.

Keep in mind that XML will be supported and I think it should work already pretty well, perhaps few tweaks would be needed.