Package net.tangly.commons.utilities
Class JsonUtilities
java.lang.Object
net.tangly.commons.utilities.JsonUtilities
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static boolean
Check if the JSON file is valid against the JSON schema describing the structure of the JSON file.static Set
<com.networknt.schema.ValidationMessage> validateSchema
(@NotNull Reader reader, @NotNull String resource) Validate the JSON file against the JSON schema describing the structure of the JSON file.
-
Method Details
-
isValid
Check if the JSON file is valid against the JSON schema describing the structure of the JSON file.- Parameters:
jsonFile
- JSON file which structure should be validatedresource
- name of the resource containing the JSON schema to validate against- Returns:
- true if no validation error was found otherwise false
-
isValid
-
validateSchema
public static Set<com.networknt.schema.ValidationMessage> validateSchema(@NotNull @NotNull Reader reader, @NotNull @NotNull String resource) Validate the JSON file against the JSON schema describing the structure of the JSON file.- Parameters:
resource
- name of the resource containing the JSON schema to validate against- Returns:
- set of validation messages if validation errors were found otherwise empty set
-