From 1f77c0e6d63db6fb419f0f8919396de9679dca28 Mon Sep 17 00:00:00 2001 From: Vignesh-Kalyanasundaram Date: Thu, 17 Oct 2024 19:30:05 +0530 Subject: [PATCH] EDGPATRON-149 Fix contracts --- ramls/examples/user_error.json | 4 ++-- ramls/schemas/user_error_400.schema | 20 +++++++++++--------- ramls/schemas/user_error_404.schema | 24 +++++++++++------------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ramls/examples/user_error.json b/ramls/examples/user_error.json index bb7a6cb..3cb146d 100644 --- a/ramls/examples/user_error.json +++ b/ramls/examples/user_error.json @@ -1,4 +1,4 @@ { - "code": 404, - "errorMessage": "USER_ACCOUNT_INACTIVE" + "code": "USER_ACCOUNT_INACTIVE", + "errorMessage": "User account is not active" } diff --git a/ramls/schemas/user_error_400.schema b/ramls/schemas/user_error_400.schema index bc4bce5..55f2f61 100644 --- a/ramls/schemas/user_error_400.schema +++ b/ramls/schemas/user_error_400.schema @@ -1,21 +1,23 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "id": "external_patron_error.schema", - "description": "An external_patron user error", + "id": "user_error.schema", + "description": "user errors", "type": "object", "properties": { "code": { - "type": "integer", - "description": "Error code" + "type": "string", + "description": "Error code", + "examples": [ + "MULTIPLE_USER_WITH_EMAIL", + "EMAIL_NOT_PROVIDED" + ] }, "errorMessage": { "type": "string", - "description": "Error message text", + "description": "Error code description", "examples": [ - { - "value": "MULTIPLE_USER_EXISTS", - "description": "Multiple users found with the same email" - } + "Multiple users found with the same email", + "emailId is missing in the request" ] } }, diff --git a/ramls/schemas/user_error_404.schema b/ramls/schemas/user_error_404.schema index d5fcd28..31d65bb 100644 --- a/ramls/schemas/user_error_404.schema +++ b/ramls/schemas/user_error_404.schema @@ -1,25 +1,23 @@ { "$schema": "http://json-schema.org/draft-04/schema#", - "id": "external_patron_error.schema", - "description": "An external_patron user error", + "id": "user_error.schema", + "description": "user errors", "type": "object", "properties": { "code": { - "type": "integer", - "description": "Error code" + "type": "string", + "description": "Error code", + "examples": [ + "USER_ACCOUNT_INACTIVE", + "USER_NOT_FOUND" + ] }, "errorMessage": { "type": "string", - "description": "Error message text", + "description": "Error code description", "examples": [ - { - "value": "USER_ACCOUNT_INACTIVE", - "description": "User is not active" - }, - { - "value": "USER_NOT_FOUND", - "description": "User does not exist" - } + "User account is not active", + "User does not exist" ] } },