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

PIL-1600 Add Error Response Examples to API Specifications #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JamesMMiller
Copy link
Contributor

@JamesMMiller JamesMMiller commented Jan 16, 2025

This PR updates the API specifications by adding standardized error response examples to app.routes and generated a new application.yaml from it.

Note: During these updates, some inconsistencies in our API error handling were identified but not addressed in this PR. Additionally, each endpoint may require specific 422 Unprocessable Entity error examples as they are a different set per endpoint.

Changes

  • conf/app.routes:
    • Added 401 Unauthorized error responses with a generic message.
    • Provided examples for InvalidJson, EmptyRequestBody, GenericServerError, and NoSubscriptionData.
    • Generated a new application.yaml from this

Inconsistencies Found

  • Malformed Response Handling:

    • BTN endpoints return detailed JSON errors (UnparsableResponse) to the client, while UKTR endpoints use a generic "Internal Server Error" (UnexpectedResponse).
  • AuthenticationError Usage:

    • All authentication errors currently map to 401 Unauthorized, though some might be more appropriate as 403 Forbidden or 400 Bad Request.

These inconsistencies should probably be addressed in future PRs to ensure uniform error responses across the API.

@platops-pr-bot
Copy link

@JamesMMiller JamesMMiller changed the title PIL-1600 Add some example responses to the application.yaml PIL-1600 Add Error Response Examples to API Specifications Jan 16, 2025
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