raw-data-api
raw-data-api copied to clipboard
Enhance documentation/API documentation and examples
What type of PR is this?
- [ ] 📝 Documentation
Related Issue :
- #219
What does this PR do?
-
Makes updates to
Auth,Extract,Tasks,Custom Exports,Stats,HDXandS3endpoints -
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?
- Clone this repo
- Follow Docker Installation Guide or local installation guide
- Shoot the server up and view the Documentation changes on your localhost
Screenshots :
Before:
After my changes:
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.