Skip to content

Commit

Permalink
EDGPATRON-142: added API doc for external_patron error scenario
Browse files Browse the repository at this point in the history
  • Loading branch information
kverma2013 committed Aug 5, 2024
1 parent 6acaa82 commit 2338f4b
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 7 deletions.
16 changes: 10 additions & 6 deletions ramls/edge-patron.raml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ types:
allowedServicePoints: !include allowed-service-points-response.json
hold-cancellation: !include hold-cancellation.json
errors: !include raml-util/schemas/errors.schema
external_patron_error: !include raml-util/schemas/external_patron_error.schema

/patron:
displayName: Patron Services
Expand Down Expand Up @@ -70,8 +71,9 @@ types:
422:
description: Validation error
body:
text/plain:
example: Validation error
application/json:
type: external_patron_error
example: !include examples/external_patron_error.json
500:
description: |
Internal server error, e.g. due to misconfiguration
Expand Down Expand Up @@ -185,8 +187,9 @@ types:
400:
description: Bad request
body:
text/plain:
example: unable to process request
application/json:
type: external_patron_error
example: !include examples/external_patron_error.json
401:
description: Not authorized to perform requested action
body:
Expand All @@ -195,8 +198,9 @@ types:
404:
description: Item with a given ID not found
body:
text/plain:
example: item not found
application/json:
type: external_patron_error
example: !include examples/external_patron_error.json
403:
description: Access Denied
body:
Expand Down
4 changes: 4 additions & 0 deletions ramls/examples/external_patron_error.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"code": 422,
"errorMessage": "USER_ALREADY_EXIST"
}
1 change: 0 additions & 1 deletion ramls/raml-util
Submodule raml-util deleted from 4aaeff
50 changes: 50 additions & 0 deletions ramls/raml-util/schemas/external_patron_error.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"$schema":"http://json-schema.org/draft-04/schema#",
"id":"external_patron_error.schema",
"description":"An external_patron user error",
"type":"object",
"properties":{
"code":{
"type":"integer",
"description":"Error code"
},
"errorMessage":{
"type":"string",
"description":"Error message text",
"examples":[
{
"value":"MULTIPLE_USER_WITH_EMAIL",
"description":"Multiple users found with the same email"
},
{
"value":"USER_ACCOUNT_INACTIVE",
"description":"User account is not active"
},
{
"value":"USER_ALREADY_EXIST",
"description":"User already exists"
},
{
"value":"USER_NOT_FOUND",
"description":"User does not exist"
},
{
"value":"EMAIL_ALREADY_EXIST",
"description":"User already exists with email provided in payload"
},
{
"value":"INVALID_PATRON_GROUP",
"description":"User does not belong to the required patron group"
},
{
"value":"PATRON_GROUP_NOT_APPLICABLE",
"description":"Required Patron group not applicable for user"
}
]
}
},
"required":[
"code",
"errorMessage"
]
}

0 comments on commit 2338f4b

Please sign in to comment.