package mcp-kit
Module Jsonschema_core.InstanceSource
JSON instance data model for JSON Schema.
Provides equality, type checking, and utility functions that match the JSON Schema specification semantics (not OCaml structural equality).
Deep equality per JSON Schema spec. Numbers compare by mathematical value: 1 = 1.0. Booleans are never equal to numbers: true <> 1. Objects compare as unordered key-value sets.
Count Unicode codepoints in a UTF-8 string. This is the "length" used by maxLength/minLength per spec.
Convert a JSON number to float. Returns None for non-numbers.
Convert a JSON number to an OCaml native int if possible. Returns None for non-integers, non-numbers, and integer values outside the native int range. This is not an arbitrary-precision JSON integer conversion: is_type "integer" (`Intlit s) can be true while to_int (`Intlit s) is None. Float 1.0 returns Some 1.