/jship

JShip is a specification for a simple, no-frills, JSON based format for application-level communication. It is a derivative from the JSend Specification.

BSD 3-Clause "New" or "Revised" LicenseBSD-3-Clause

JShip

For general information visit the parent repository

Changes

The fail return type is now the same as error, just with different purposes

TypeDescriptionRequired KeysOptional Keys
successAll went well, and (usually) some data was returned.status, data
failThere was a problem with the data submitted, or some pre-condition of the API call wasn't satisfiedstatus, messagecode, data
errorAn error occurred in processing the request, i.e. an exception was thrownstatus, messagecode, data

Fail

When an API call is rejected due to invalid data or call conditions. For example:

POST /posts.json (with data body: "Trying to creating a blog post"):

{
    "status" : "fail",
    "message" : "A title is required"
}

Required keys:

  • status: Should always be set to "fail".
  • message: A meaningful, end-user-readable (or at the least log-worthy) message, explaining what went wrong.

Optional keys:

  • code: A numeric code corresponding to the error, if applicable
  • data: A generic container for any other information about the fail, i.e. the conditions that caused the fail, wrong parameters, etc. If the reasons for failure correspond to POST values, the response object's keys SHOULD correspond to those POST values.

License

The JShip specification (this page) is covered under the same license as its parent project: modified BSD License