PIL-1600 Add Error Response Examples to API Specifications #57
+187
−21
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.
This PR updates the API specifications by adding standardized error response examples to
app.routes
and generated a newapplication.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
:401 Unauthorized
error responses with a generic message.InvalidJson
,EmptyRequestBody
,GenericServerError
, andNoSubscriptionData
.application.yaml
from thisInconsistencies Found
Malformed Response Handling:
UnparsableResponse
) to the client, while UKTR endpoints use a generic "Internal Server Error" (UnexpectedResponse
).AuthenticationError Usage:
401 Unauthorized
, though some might be more appropriate as403 Forbidden
or400 Bad Request
.These inconsistencies should probably be addressed in future PRs to ensure uniform error responses across the API.