Class JsonDefaultValueConverter

java.lang.Object
io.confluent.kafka.schemaregistry.type.logical.json.JsonDefaultValueConverter

public final class JsonDefaultValueConverter extends Object
Encodes/decodes default values for JSON Schema.
  • Method Details

    • toJsonValue

      public static Object toJsonValue(Schema type, Object value)
      Encode a typed Java default value into a JSON-schema-friendly form.
    • toJavaData

      public static Object toJavaData(Schema type, Object value)
      Decode a JSON-schema default value back into a typed Java value. Returns null when the value's JSON type doesn't match the LT type — the caller (the schema reader's default-capture path) treats a null return as "drop this default" rather than failing the whole schema walk. This keeps in-the-wild schemas with malformed defaults parseable.
    • toIsoInstant

      public static String toIsoInstant(Instant instant)
      Convenience: encode and produce a string suitable for ISO timestamp etc.