Skip to content

gkamal/REST

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Brief Description

The project is meant to be a Proof of Concept implementation of a RESTful web service.
It focuses on topics such as:

TECHNOLOGY STACK

Implementation of a RESTfull web API, using:

  • Spring 3.1 with Jackson, JAXB
  • Hibernate 3.6 (to be moved to Hibernate 4.0 soon)
  • Testing: Junit, Mockito, Hamcrest, rest-assured

REST WEB API

GET /api/helloWorld/{id}
- http response codes: 200, 404, 500
- json (request/response): none/single resource
- retrieves the resource by id

POST /api/helloWorld
- http response codes: 201, 415, 500
- json (request/response): single resource/none
- creates a new resource

PUT /api/helloWorld
- http response codes: 200, 400, 404, 500
- json (request/response): single resource/none
- updates an existing resource

DELETE /api/helloWorld/{id}
- http response codes: 200, 404, 500
- json (request/response): none/none
- delete an existing resource by id

GET /api/helloWorld
- http response codes: 200, 500
- json (request/response): none/multiple resources
- retrieves all resources of that type

JSON payloads

  • single resource: { "name": "Dvthix", "id": 1 }

  • multiple resources: [ { "name": "Dvthix", "id": 1 }, { "name": "cPfCwV", "id": 2 }, ]

ADDITIONAL BLOG DISCUSSIONS (backed by this project)

===================

FURTHER DEVELOPMENT

======================

  • improvements in validation and HTTP response codes
  • improving the marshaling of the server stack trace
  • improve the discoverability of the REST API - make good use of the Location HTTP header for returning full URLs (not just ids) so that the client doesn't have to construct his own URLs; introduce a /about URL to make discoverability better
  • expand on the design document, covering: details of the transaction strategy

Releases

No releases published

Packages

No packages published