From 4e94a88aca5d0f650481fa51c58b438405948f5e Mon Sep 17 00:00:00 2001 From: Mohd Kaif Siddique Date: Fri, 29 Nov 2024 15:59:13 +0530 Subject: [PATCH] modified schema validation now only one schema required to validate bot create and update identity object Signed-off-by: Mohd Kaif Siddique Signed-off-by: kaifk468 --- .../mock-identity-create-schema.json | 267 ------------------ .../mock-identity-update-schema.json | 254 ----------------- 2 files changed, 521 deletions(-) delete mode 100644 mock-identity-system/src/main/resources/mock-identity-create-schema.json delete mode 100644 mock-identity-system/src/main/resources/mock-identity-update-schema.json diff --git a/mock-identity-system/src/main/resources/mock-identity-create-schema.json b/mock-identity-system/src/main/resources/mock-identity-create-schema.json deleted file mode 100644 index 69aa1151..00000000 --- a/mock-identity-system/src/main/resources/mock-identity-create-schema.json +++ /dev/null @@ -1,267 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "$defs": { - "langField": { - "type": "array", - "items": { - "type": "object", - "properties": { - "language": { - "type": "string" - }, - "value": { - "type": "string" - } - }, - "required": [ - "language", - "value" - ], - "additionalProperties": false - } - } - }, - "properties": { - "individualId": { - "type": "string", - "pattern": "^\\+855\\d{9}$" - }, - "fullName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "nullable": true - }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, - "givenName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "familyName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "middleName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "nickName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "preferredUsername": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "gender": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "streetAddress": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - - } - } - } - } - ] - }, - "locality": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "region": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "country": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "pin": { - "type": "string", - "pattern": "\\S" - }, - "preferredLang": { - "type": "string" - }, - "dateOfBirth": { - "type": "string", - "pattern": "\\S" - }, - "postalCode": { - "type": "string", - "pattern": "\\S" - }, - "encodedPhoto": { - "type": "string" - }, - "email": { - "type": "string", - "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$" - }, - "phone": { - "type": "string", - "pattern": "\\S" - }, - "zoneInfo": { - "type": "string" - }, - "locale": { - "type": "string", - "pattern": "\\S" - }, - "password": { - "type": "string", - "pattern": "\\S" - } - }, - "required": [ - "individualId", - "fullName", - "name", - "givenName", - "familyName", - "middleName", - "nickName", - "preferredUsername", - "gender", - "streetAddress", - "locality", - "region", - "country", - "pin", - "preferredLang", - "dateOfBirth", - "postalCode", - "encodedPhoto", - "email", - "phone", - "zoneInfo", - "locale", - "password" - ], - "additionalProperties": false -} \ No newline at end of file diff --git a/mock-identity-system/src/main/resources/mock-identity-update-schema.json b/mock-identity-system/src/main/resources/mock-identity-update-schema.json deleted file mode 100644 index 4db8b953..00000000 --- a/mock-identity-system/src/main/resources/mock-identity-update-schema.json +++ /dev/null @@ -1,254 +0,0 @@ -{ - "$schema": "https://json-schema.org/draft/2020-12/schema", - "type": "object", - "$defs": { - "langField": { - "type": "array", - "items": { - "type": "object", - "properties": { - "language": { - "type": "string", - "nullable": true - }, - "value": { - "type": "string", - "nullable": true - } - }, - "required": [ - "language", - "value" - ], - "additionalProperties": false - }, - "nullable": true - } - }, - "properties": { - "individualId": { - "type": "string", - "pattern": "^\\+855\\d{9}$" - }, - "fullName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "name": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - - } - } - } - } - ] - }, - "givenName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "familyName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "middleName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "nickName": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "preferredUsername": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,40}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ]{1,40})$" - } - } - } - } - ] - }, - "gender": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "streetAddress": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - - } - } - } - } - ] - }, - "locality": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "region": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ0-9\\s.,°№-]{1,200}|[ء-ي\\s-٩ٱ-ڿﹰ-\uFEFF\u0600-ۿ0-9]{1,200})$" - } - } - } - } - ] - }, - "country": { - "allOf": [ - { "$ref": "#/$defs/langField" }, - { - "items": { - "properties": { - "value": { - "pattern": "^(?:[a-zA-ZÀ-ÿ\\s]{1,20}|^[ء-ي\\s\\u0621-\\u064A\\u0660-\\u0669\\u0671-\\u06BF\\uFE70-\\uFEFF\\u0600-\\u06FFگچپژیلفقهمو ء-ي]{1,20}$)$" - } - } - } - } - ] - }, - "pin": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "preferredLang": { - "type": "string", - "nullable": true - }, - "dateOfBirth": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "postalCode": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "encodedPhoto": { - "type": "string" - }, - "email": { - "type": "string", - "pattern": "^[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+\\.[a-zA-Z0-9-.]+$", - "nullable": true - }, - "phone": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "zoneInfo": { - "type": "string", - "nullable": true - }, - "locale": { - "type": "string", - "pattern": "\\S", - "nullable": true - }, - "password": { - "type": "string", - "pattern": "\\S", - "nullable": true - } - }, - "required": [ - "individualId" - ], - "additionalProperties": false -} \ No newline at end of file