Interface JsonSchemaValidator
public interface JsonSchemaValidator
Interface for validating structured content against a JSON schema. This interface
defines a method to validate structured content based on the provided output schema.
- Author:
- Christian Tzolov
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordRepresents the result of a validation operation. -
Method Summary
Modifier and TypeMethodDescriptionstatic JsonSchemaValidatorCreates the defaultJsonSchemaValidator.static JsonSchemaValidatorReturns the defaultJsonSchemaValidator.Validates the structured content against the provided JSON schema.
-
Method Details
-
validate
JsonSchemaValidator.ValidationResponse validate(Map<String, Object> schema, Object structuredContent) Validates the structured content against the provided JSON schema.- Parameters:
schema- The JSON schema to validate against.structuredContent- The structured content to validate.- Returns:
- A ValidationResponse indicating whether the validation was successful or not.
-
createDefault
Creates the defaultJsonSchemaValidator.- Returns:
- The default
JsonSchemaValidator - Throws:
IllegalStateException- If noJsonSchemaValidatorimplementation exists on the classpath.
-
getDefault
Returns the defaultJsonSchemaValidator.- Returns:
- The default
JsonSchemaValidator - Throws:
IllegalStateException- If noJsonSchemaValidatorimplementation exists on the classpath.
-