raw-data-api icon indicating copy to clipboard operation
raw-data-api copied to clipboard

Enhance documentation/API documentation and examples

Open nifedara opened this issue 1 year ago • 0 comments

What type of PR is this?

  • [ ] 📝 Documentation

Related Issue :

  • #219

What does this PR do?

  • Makes updates to Auth, Extract, Tasks, Custom Exports, Stats, HDX and S3 endpoints

  • Adds top-level security

  • Adds API description

  • Adds endpoints description

  • Adds path and query parameters description

  • Adds an error message model

  • Updates the HTTPException response to match the error model

  • Adds 200, 401, 403, 404, 429, & 500 responses and examples to endpoints

  • Removes trailing slashes from endpoints

Consideration :

  • The top-level security will save users from repeatedly entering the access code for every protected endpoint
  • Having parameters defined helps the users understand the API better.
  • The error model helps maintain the consistency of error that the user expects and it is also recommended for API security that response schemas be used hence why I added a model for Error messages.
  • Removing the trailing slashes is good practice that ensures consistency in the endpoints
  • I was proactive in getting the responses from each endpoint.
  • Increases the API score from 54 to 69. I still intend to improve it more.

How to test?

Screenshots :

Before:

image image

After my changes:

image image

Checklists:

Checklist before requesting a review :

  • 📖 Read the HOT Code of Conduct: https://docs.hotosm.org/code-of-conduct
  • 👷‍♀️ Create small PRs. In most cases, this will be possible.
  • ✅ Provide tests for your changes.
  • 📝 Use descriptive commit messages.
  • 📗 Update any related documentation and include any relevant screenshots.

[optional] What gif best describes this PR or how it makes you feel?

nifedara avatar Aug 14 '24 11:08 nifedara