-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gunda Abhishek
committed
Dec 11, 2024
1 parent
33b3517
commit f40f681
Showing
14 changed files
with
511 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
leia-common/src/main/java/com/grookage/leia/common/violation/LeiaSchemaViolation.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,19 @@ | ||
package com.grookage.leia.common.violation; | ||
|
||
public interface LeiaSchemaViolation { | ||
|
||
/** | ||
* @return Error message for the violation | ||
*/ | ||
String message(); | ||
|
||
/** | ||
* @return Relative path of the field being validated from the {@code rootKlass} | ||
*/ | ||
String fieldPath(); | ||
|
||
/** | ||
* @return Class of the field being validated | ||
*/ | ||
Class<?> rootKlass(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
leia-common/src/test/resources/invalidNestedStubSchema.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
{ | ||
"namespace": "testNamespace", | ||
"schemaName": "NestedStub", | ||
"version": "V1234", | ||
"schemaState": "CREATED", | ||
"schemaType": "JSON", | ||
"validationType": "STRICT", | ||
"schemaMeta": { | ||
"createdBy": "testUser" | ||
}, | ||
"attributes": [ | ||
{ | ||
"type": "INTEGER", | ||
"name": "phoneNumber", | ||
"optional": false, | ||
"qualifiers": [ | ||
{ | ||
"type": "PII" | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "OBJECT", | ||
"name": "piiData", | ||
"optional": false, | ||
"qualifiers": [ | ||
{ | ||
"type": "ENCRYPTED" | ||
}, | ||
{ | ||
"type": "PII" | ||
} | ||
], | ||
"nestedAttributes": [ | ||
{ | ||
"type": "STRING", | ||
"name": "accountNumber", | ||
"optional": false, | ||
"qualifiers": [ | ||
{ | ||
"type": "ENCRYPTED" | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"type": "LONG", | ||
"name": "id", | ||
"optional": false, | ||
"qualifiers": [] | ||
}, | ||
{ | ||
"type": "ENUM", | ||
"name": "enumClass", | ||
"optional": false, | ||
"qualifiers": [], | ||
"values": [ | ||
"ONE", | ||
"TWO" | ||
] | ||
}, | ||
{ | ||
"type": "OBJECT", | ||
"name": "recordStub", | ||
"optional": false, | ||
"qualifiers": [ | ||
{ | ||
"type": "ENCRYPTED" | ||
} | ||
], | ||
"nestedAttributes": [ | ||
{ | ||
"type": "INTEGER", | ||
"name": "id", | ||
"optional": true, | ||
"qualifiers": [] | ||
}, | ||
{ | ||
"type": "STRING", | ||
"name": "name", | ||
"optional": false, | ||
"qualifiers": [ | ||
{ | ||
"type": "PII" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.