Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance/raw-data-api #1

Open
wants to merge 64 commits into
base: develop
Choose a base branch
from
Open

Enhance/raw-data-api #1

wants to merge 64 commits into from

Conversation

nifedara
Copy link
Owner

@nifedara nifedara commented Mar 12, 2024

What does this PR do?

Enhances documentation quality

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 Error message model
  • Updates HTTPException response to match the error model
  • Adds 401, 403, 404, 429 and 500 responses to endpoints
  • Adds examples for 200, 401, 403, 404, 429 and 500 responses
  • Removes trailing slashes from endpoints
  • Contributes to resolving this issue: (Enhance API documentation and examples hotosm/raw-data-api#219)
  • Increases the API score from 56 to 71 🎉🎉

Consideration?

  • The top-level security will help users from repeatedly entering the access code for each protected endpoint
  • Having responses defined helps the users handle errors better and having examples help them to better use the API
  • 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 message
  • Removing the trailing slashes is good practice that ensures consistency in the endpoints
  • A nice-to-have will be a rate limit for all the endpoints. At the moment, only the extract/snapshot endpoint implements rate-limiting
  • I used black formatter

How to test?

Screenshot

raw-data-api

@nifedara
Copy link
Owner Author

@kshitijrajsharma, please what is a black formatter?
I don't understand it in this context:

"What should be included in PR:
Black formatter should be used
At least mention following section..."

@nifedara
Copy link
Owner Author

raw-data-api

Here is a snapshot of [part of] what it looks like

@kshitijrajsharma
Copy link

@kshitijrajsharma, please what is a black formatter?

I don't understand it in this context:

"What should be included in PR:

Black formatter should be used

At least mention following section..."

Black formatter is popular python code formatter / linter , Learn more here https://github.com/psf/black

@nifedara
Copy link
Owner Author

@kshitijrajsharma, please what is a black formatter?
I don't understand it in this context:
"What should be included in PR:
Black formatter should be used
At least mention following section..."

Black formatter is popular python code formatter / linter , Learn more here https://github.com/psf/black

Thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants