openbeerdatabase/openbeerdatabase — pull request #13 by jesseadams (2013-03-03 00:45:47+00:00)
Title: Add beer styles

First of all, thanks for creating this open API for beer. I was about to create one from scratch and this saved me a lot of time. There are a couple things I hope to add to the API if you agree. The most important one of them is included in this pull request. Several competing APIs (closed ones) include beer styles. I feel that this is an important piece of information. I find myself learning quite a bit of information when I try a new beer out of my comfort zone and I look up the style description. I think this would make a great addition to the API.

I tried to follow your conventions as much as possible. I created as many tests as I could to match your current set and everything passes. I updated the documentation as needed and tested all endpoints locally via curl requests on CLI. Please let me know if you have any questions or notice anything that needs more work. There were a couple of pieces that potentially need some more love before this can be merged in.

1. In the current docs I didn't see a way to update the brewery_id on beers so I didn't look into it for beer_style_id either. This will keep all current beers without style information with potentially no way to update them through the API.
2. Creating a new beer REQUIRES beer_style_id. This may break current clients that use the existing API but it would be for creation only. I made sure that accessing beer records that don't have style information would still work.

Thanks!

Jesse