function_values library
Strict bounded JSON codecs and validators for function contracts.
Functions
-
encodeFunctionJson(
Object? value, {int maxBytes = 2097152, int maxDepth = 12}) → Uint8List - Encodes finite plain JSON only; never invokes a user object's toJson hook.
-
functionJsonNumber(
num value) → String -
A finite number as
JSON.stringifywrites it. The strict parser keeps an integral value beyond 2^53 as a double, whichjsonEncodewould print with a trailing.0: below 1e21 an integral double is written as its shortest integer decimal, and negative zero as0. Every other finite number already matches: both languages print the shortest round-trip decimal, in exponent form from 1e21 and below 1e-6. -
parseFunctionJson(
Uint8List bytes, {int maxBytes = 2097152, int maxDepth = 12}) → Object? - Strict, bounded JSON before ordinary decoding can discard duplicate keys.
-
validateFunctionSchema(
Map< String, Object?> schema, Object? value, {Map<String, Object?> references = const {}, int maxDepth = 8, bool utf16StringBounds = false}) → void -
Validate decoded project values or generated private schemas without coercion.
referencesis generated from TypeBox; callers cannot supply remote schemas.