Improve error handling in OpenAPI spec#1
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
Conversation
- Add ErrorResponse schema with type, title, status, detail, and errors fields
- Add missing 401 Unauthorized to endpoints that lacked it (Auth/Logout,
PortalSearch, User/ProfileImage, User/GetAvailableFunds)
- Add missing 403 Forbidden to all admin-only endpoints
- Add missing 404 Not Found to path-parameter endpoints (AdminStore/Get/{id},
AdminStore/Edit/{id})
- Add missing 400 Bad Request to endpoints with request bodies or query params
that lacked it
- Add 500 Internal Server Error to all endpoints
- Add ErrorResponse body schema to previously bare error responses (e.g. 401
that only had a description string)
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The OpenAPI spec had many endpoints that silently swallowed errors — returning only
200with no documented error responses — and others where error responses existed but lacked response body schemas, making it impossible for clients to parse error details.Added
ErrorResponseschema (components/schemas/ErrorResponse) with RFC 7807-style fields:type,title,status,detail,errors(validation errors keyed by field).Endpoints that previously had zero error responses (errors completely swallowed):
GET /api/Auth/Logout— added401,500GET /api/PortalSearch/Index— added400,401,500GET /api/User/ProfileImage— added400,401,500POST /api/User/ProfileImage— added400,401,500GET /api/User/GetAvailableFunds— added400,401,500Missing
404on path-parameter lookups:GET /api/AdminStore/Get/{id},POST /api/AdminStore/Edit/{id}— added404GET /api/Transaction/Get/{id}already had404)Missing
403 Forbiddenon admin-only endpoints:/api/Admin/*and/api/AdminStore/*endpoints — added403Missing
500 Internal Server Error:Bare error responses (e.g.
"401": {"description": "Unauthorized"}with nocontent):400/401/404responses now includecontent: { "application/json": { schema: $ref ErrorResponse } }.Link to Devin session: https://app.devin.ai/sessions/0b3ccb2f1561491693e5dde9aecf7c8e
Requested by: @wsh92