Open jessecarl opened 7 years ago
This comes down to mapping http requests to the store methods and other functions exposed by the API. We have the following endpoints:
NewResource() faststatus.Resource
at (GET|HEAD) /new
store.Get(faststatus.ID) (faststatus.Resource, error)
at (GET|HEAD) /{{id}}
store.Save(faststatus.Resource) error
at (PUT) /{{id}}
Given these simple mappings, we only really need a decoder for the store.Save
method. One remaining question is what order errors present themselves. I think, for the purpose of this service, the correct path is checked before the correct method.
Part of #36
Inspect the Content-Type being provided in the request body and use the correct decoder to unmarshal Resources.
Unsupported request body content type should result in a 415 response.