Class JsonSchemaValidator
java.lang.Object
ai.timefold.solver.service.json.internal.schema.JsonSchemaValidator
- All Implemented Interfaces:
ai.timefold.solver.service.definition.api.validation.Validator<com.fasterxml.jackson.databind.node.ObjectNode>
@ApplicationScoped
public class JsonSchemaValidator
extends Object
implements ai.timefold.solver.service.definition.api.validation.Validator<com.fasterxml.jackson.databind.node.ObjectNode>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.fasterxml.jackson.databind.ObjectMapperprotected com.networknt.schema.SchemaValidatorsConfigprotected com.networknt.schema.JsonSchemaFactory -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected JsonSchemaDescloadSchema(UUID tenantId, String id, String version, String operation) Loads JSON schema from resources.protected Stringprotected Stringprotected Stringprotected voidremoveFromCache(String keyExpression) Removes a JSON schema from a local cache.voidsetup()validate(UUID tenantId, String id, String version, String operation, String configurationId, com.fasterxml.jackson.databind.node.ObjectNode entity)
-
Field Details
-
mapper
protected com.fasterxml.jackson.databind.ObjectMapper mapper -
validatorFactory
protected com.networknt.schema.JsonSchemaFactory validatorFactory -
schemaValidatorsConfig
protected com.networknt.schema.SchemaValidatorsConfig schemaValidatorsConfig
-
-
Constructor Details
-
JsonSchemaValidator
public JsonSchemaValidator()
-
-
Method Details
-
setup
@PostConstruct public void setup() -
validate
public List<String> validate(UUID tenantId, String id, String version, String operation, String configurationId, com.fasterxml.jackson.databind.node.ObjectNode entity) - Specified by:
validatein interfaceai.timefold.solver.service.definition.api.validation.Validator<com.fasterxml.jackson.databind.node.ObjectNode>
-
lookupKey
-
lookupKey
-
lookupKey
-
loadSchema
Loads JSON schema from resources.This method is overridden in the platform to provide tenant-aware schema loading
-
removeFromCache
Removes a JSON schema from a local cache.This method is used by the platform to remove schemas when a registered model changes.
-