Skip to content

Improve error handling in OpenAPI spec#1

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782936997-improve-error-handling
Open

Improve error handling in OpenAPI spec#1
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1782936997-improve-error-handling

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

The OpenAPI spec had many endpoints that silently swallowed errors — returning only 200 with 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 ErrorResponse schema (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 — added 401, 500
  • GET /api/PortalSearch/Index — added 400, 401, 500
  • GET /api/User/ProfileImage — added 400, 401, 500
  • POST /api/User/ProfileImage — added 400, 401, 500
  • GET /api/User/GetAvailableFunds — added 400, 401, 500

Missing 404 on path-parameter lookups:

  • GET /api/AdminStore/Get/{id}, POST /api/AdminStore/Edit/{id} — added 404
  • (GET /api/Transaction/Get/{id} already had 404)

Missing 403 Forbidden on admin-only endpoints:

  • All /api/Admin/* and /api/AdminStore/* endpoints — added 403

Missing 500 Internal Server Error:

  • Added to every endpoint (none had it before).

Bare error responses (e.g. "401": {"description": "Unauthorized"} with no content):

  • All existing bare 400/401/404 responses now include content: { "application/json": { schema: $ref ErrorResponse } }.

Link to Devin session: https://app.devin.ai/sessions/0b3ccb2f1561491693e5dde9aecf7c8e
Requested by: @wsh92

- 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>
@wsh92 wsh92 self-assigned this Jul 1, 2026
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

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.

1 participant