#111 Always return JSON?
Opened 2 years ago by qulogic. Modified 2 years ago

In looking around, it's a bit inconsistent on what gets returned by errors for REST.

I've found:

  • Microsoft's API guide that returns {error: {code: 404, message: '...'}} (plus some optional fields),
  • RFC 7807 that returns {type: '...', title: '...'} (plus other optional fields),
  • JSON API that returns {errors: [{status: '...', title: '...'}, ...]},
  • Flask-Restful that returns {message: '...'},
  • OpenAPI that returns {code: '...', message: '...'} (may be flexible).

Login to comment on this ticket.

Metadata