-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Updates to API 404 responses #6077
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6077 +/- ##
=========================================
Coverage ? 38.87%
=========================================
Files ? 365
Lines ? 51341
Branches ? 0
=========================================
Hits ? 19957
Misses ? 28511
Partials ? 2873
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer a path.Join in there instead of fmt.Sprintf
It should probably moved to some kind of helper method as all 404 errors (also ones returned from methods where record by id is not found etc) should return same imho |
Replaced all API method 404s with above method
…into 6052_better_404
For the record, I had planned on fixing both things in the original issue, but perhaps this should be a PR on its own just for API 404s. 😄 |
This PR is marked as WIP, is it still WIP? |
I guess it depends on whether we want the other sub-issue in the original issue fixed in this PR or a separate one. If not, this is complete for API 404s. |
No comment on the original issue, so I will count this PR as just fixes to API 404s. |
This PR will address #6052
So far it handles API 404s.
Instead of a blank 404, it returns a JSON response with a
message
of "Not Found" and adocumentation_url
pointing to the basic swagger endpoint. e.g.https://try.gitea.io/api/swagger