API - Define a consumable JSON error payload for 400 errors #71

Open
lholman opened this Issue Apr 3, 2014 · 1 comment

Comments

Projects
None yet
1 participant
@lholman
Member

lholman commented Apr 3, 2014

Currently errors are just text formatted as JSON.
This article http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api#errors explains it very well.

We should aim for something like this, a nice consumable error for everything HTTP 400 related.

{
  "code" : 1234,
  "message" : "HTTP 405 - Method Not Allowed",
  "description" : "The Service 'featureswitchtype' does not support parameter querying.  As in you can't do this http://example.com/femah.axd/api/featureswitchtypes/givemeatype"
}

I don't think we should handle granular validation errors as of yet, maybe if the API ever gets used.

Also, update the http://lloydstone.github.io/femah/api.html documentation accordingly with error code mappings.

@lholman lholman added this to the MVP milestone Apr 3, 2014

@lholman lholman added the enhancement label Apr 3, 2014

@lholman

This comment has been minimized.

Show comment
Hide comment
@lholman

lholman Apr 3, 2014

Member

Note, probably best to fix or at least look at #70 at the same time.

Member

lholman commented Apr 3, 2014

Note, probably best to fix or at least look at #70 at the same time.

@lholman lholman modified the milestone: MVP Apr 3, 2014

@lholman lholman assigned lholman and unassigned lholman Apr 7, 2014

@lholman lholman modified the milestones: MVP, V1.1 Apr 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment