Google-IO-Extended-Grand-Rapids / conference_web

The conference app REST API
5 stars 1 forks source link

Create stub service for requesting conference sessions given a conference_id #21

Closed mccrackend closed 9 years ago

mccrackend commented 9 years ago

Conference_id should be a required field. Stub should include associated downstream objects for: -Conference Session Presenter -Presenter -Conference Session Type -Room -Company

Database Designn

chenry commented 9 years ago

With the conference_id being a required field, it now begs the question...How will we handle exceptions in the REST API? Here are two references I found:

https://blog.apigee.com/detail/restful_api_design_what_about_errors - shows examples of three different popular REST APIs and how they handle exceptions.

https://stormpath.com/blog/spring-mvc-rest-exception-handling-best-practices-part-1 - this shows an example of how to do it using Spring.

My preference is the second option, but for now, I am fine with throwing an Exception and therefore no response coming back to the client application. However, I am interested in discussing more.

chenry commented 9 years ago

Here is another example / library that may prove to be easier to implement for handling REST API Exceptions.

https://github.com/jirutka/spring-rest-exception-handler

mccrackend commented 9 years ago

/api/conference/{conference_id}/conferenceSessions

OR

/api/conference/{conference_id}/sessions