Skip to content

Enhance/raw-data-api#1

Open
nifedara wants to merge 64 commits intodevelopfrom
enhance/raw-data-api
Open

Enhance/raw-data-api#1
nifedara wants to merge 64 commits intodevelopfrom
enhance/raw-data-api

Conversation

@nifedara
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Owner Author

raw-data-api

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

@kshitijrajsharma
Copy link
Copy Markdown

@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
Copy Markdown
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