Uploaded image for project: 'JBoss Developer Materials'
  1. JBoss Developer Materials
  2. JDF-771

Update 'kitchensink-angularjs' quickstart to follow RESTful conventions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • None
    • quickstarts
    • None

      As it stands there are several endpoints in the kitchensink-angularjs quickstart which follow RESTful naming schemes and url structure, but which do not return responses in keeping with RESTful principles.

      I would like to update the quickstart in following ways to address this:

      • Update MemberResourceRESTService (http://git.io/1CyYUA) to:
      • Return a status of 201 upon a successful call of createMember(Member member), and include the created resource in the response.
      • Return a status of 500 upon catching a generic Exception in createMember(Member member) . User input validation is handled earlier, and a generic exception here would probably imply some unexpected behaviour, which would make a 500 error semantically appropriate.
      • Update controllers.js, removing the now needless refresh() function. The created member will be returned as part of the result in the Member.save() call and can be added to $scope.members at that stage.
      • Update RESTTest.java (http://git.io/zIFs4g) to reflect the changes to createMember(Member member) in MemberResourceRESTService.

      If these changes seem sensible to you and you would appreciate a pull request, let me know.

      Cheers

              vineet.reynolds_jira Vineet Reynolds (Inactive)
              hugofirth Hugo Firth (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated: