Class DefaultJsonSchemaValidator

java.lang.Object
io.modelcontextprotocol.json.schema.jackson.DefaultJsonSchemaValidator
All Implemented Interfaces:
JsonSchemaValidator

@Deprecated(forRemoval=true, since="18.0.0") public class DefaultJsonSchemaValidator extends Object implements JsonSchemaValidator
Deprecated, for removal: This API element is subject to removal in a future version.
since 18.0.0, use DefaultJsonSchemaValidator instead. Will be removed in 19.0.0.
Default implementation of the JsonSchemaValidator interface. This class provides methods to validate structured content against a JSON schema. It uses the NetworkNT JSON Schema Validator library for validation.
Author:
Christian Tzolov
  • Constructor Details

    • DefaultJsonSchemaValidator

      public DefaultJsonSchemaValidator()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • DefaultJsonSchemaValidator

      public DefaultJsonSchemaValidator(com.fasterxml.jackson.databind.ObjectMapper objectMapper)
      Deprecated, for removal: This API element is subject to removal in a future version.
  • Method Details

    • validate

      public JsonSchemaValidator.ValidationResponse validate(Map<String,Object> schema, Object structuredContent)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      validate in interface JsonSchemaValidator
    • generateCacheKey

      protected String generateCacheKey(Map<String,Object> schema)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Generates a cache key for the given schema map.
      Parameters:
      schema - the schema map
      Returns:
      a cache key string
    • clearCache

      public void clearCache()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Clears the schema cache. Useful for testing or memory management.
    • getCacheSize

      public int getCacheSize()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns the current size of the schema cache.
      Returns:
      the number of cached schemas