mysociety / mapit.mysociety.org

A Django project for running mySociety's main instance of MapIt for the UK
http://mapit.mysociety.org
Other
6 stars 2 forks source link

Document how the JSON API formats errors #149

Closed zarino closed 9 months ago

zarino commented 9 months ago

I was working on a project that calls the MapIt API via jQuery.ajax, and realised the documentation doesn’t explicitly say how errors are handled, so I had to work it out by trial and error.

Seemed like it’d be a useful thing to include in the docs, so I’ve added a new "Errors" section, right after the "Format" section where we talk about the JSON API format.

While I was there, I also wrapped the JSON object keys in the "Format" section in <code> tags, for consistency with how we display HTTP Header fields and query params.

Screenshot 2023-11-22 at 14 40 11

codecov[bot] commented 9 months ago

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (b5d996e) 86.22% compared to head (f984f7c) 86.22%. Report is 2 commits behind head on master.

Files Patch % Lines
api_keys/utils.py 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #149 +/- ## ======================================= Coverage 86.22% 86.22% ======================================= Files 48 48 Lines 2163 2163 ======================================= Hits 1865 1865 Misses 298 298 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.