rubysherpas / forem

The best Rails 3 and Rails 4 forum engine. Ever.
http://forem.herokuapp.com
MIT License
1.55k stars 422 forks source link

API proof of concept: forums#show #665

Open eostrom opened 9 years ago

eostrom commented 9 years ago

THIS IS NOT A REAL PULL REQUEST AND SHOULD NOT BE MERGED. It's just the easiest way for me to illustrate the approach I'm using so far and ask for feedback. This follows discussion in radar/forem#664.

@radar mentioned API keys for authentication, but I don't need them for my app, so I'm keeping it simple.

I'm writing request specs, and not feature or controller specs. It just seems like the natural level for testing this functionality.

I haven't thought about how to represent errors (or read about how JSON API does it). Nor have I started figuring out associations.

I created a separate controller hierarchy, rather than try to cram versioned API functionality into the regular controllers. I am not 100% sure about this.

I am also not sure it wouldn't be better to use JSONAPI::Resources instead of creating the views manually with jbuilder.

eostrom commented 9 years ago

Thanks, I'll make those changes next.

I've just pushed four new commits that contain tentative answers to questions I ran into:

I'm pressing ahead with these tentative answers, but let me know if you have thoughts on them.