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

EDGPATRON-144: Updated API doc for external_patron as per new modified error scenario #127

Merged
merged 3 commits into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 20 additions & 10 deletions ramls/edge-patron.raml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,10 @@ 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 schemas/external_patron_error.schema
external_patron_error_404: !include schemas/external_patron_error_404.schema
external_patron_error_get_422: !include schemas/external_patron_error_get_422.schema
external_patron_error_post_422: !include schemas/external_patron_error_post_422.schema
external_patron_error_put_422: !include schemas/external_patron_error_put_422.schema

/patron:
displayName: Patron Services
Expand Down Expand Up @@ -72,7 +75,7 @@ types:
description: Validation error
body:
application/json:
type: external_patron_error
type: external_patron_error_post_422
example: !include examples/external_patron_error.json
500:
description: |
Expand Down Expand Up @@ -154,8 +157,15 @@ types:
404:
description: Item with a given EMAIL not found
body:
text/plain:
example: account not found
application/json:
type: external_patron_error_404
example: !include examples/external_patron_error.json
422:
description: Validation error
body:
application/json:
type: external_patron_error_get_422
example: !include examples/external_patron_error.json
403:
description: Access Denied
body:
Expand Down Expand Up @@ -187,9 +197,8 @@ types:
400:
description: Bad request
body:
application/json:
type: external_patron_error
example: !include examples/external_patron_error.json
text/plain:
example: unable to process request
401:
description: Not authorized to perform requested action
body:
Expand All @@ -199,7 +208,7 @@ types:
description: Item with a given ID not found
body:
application/json:
type: external_patron_error
type: external_patron_error_404
example: !include examples/external_patron_error.json
403:
description: Access Denied
Expand All @@ -214,8 +223,9 @@ types:
422:
description: Validation error
body:
text/plain:
example: Validation error
application/json:
type: external_patron_error_put_422
example: !include examples/external_patron_error.json
500:
description: |
Internal server error, e.g. due to misconfiguration
Expand Down
26 changes: 26 additions & 0 deletions ramls/schemas/external_patron_error_404.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$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": "USER_NOT_FOUND",
"description": "User does not exist"
}
]
}
},
"required": [
"code",
"errorMessage"
]
}
26 changes: 26 additions & 0 deletions ramls/schemas/external_patron_error_get_422.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"$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"
}
]
}
},
"required": [
"code",
"errorMessage"
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,21 +24,9 @@
"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"
}
]
}
Expand Down
34 changes: 34 additions & 0 deletions ramls/schemas/external_patron_error_put_422.schema
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"$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": "EMAIL_ALREADY_EXIST",
"description": "User already exists with email provided in payload"
},
{
"value": "PATRON_GROUP_NOT_APPLICABLE",
"description": "Required Patron group not applicable for user"
},
{
"value": "MULTIPLE_USER_WITH_EMAIL",
"description": "Multiple users found with the same email"
}
]
}
},
"required": [
"code",
"errorMessage"
]
}
Loading