jsonschema.node

Internal JSON document representation.

Every schema document, whatever JSON type it arrives as (std.json.JSONValue, vibe.data.json.Json, or raw text), is normalized into JsonNode before compilation. JsonNode preserves object member order, distinguishes signed, unsigned and floating-point numbers (so 64-bit integers never round-trip through a double), and is fully self-contained — no dependency beyond phobos.

Members

Classes

JsonParseException
class JsonParseException

Thrown when JSON text cannot be parsed.

Functions

fromStdJson
JsonNode fromStdJson(JSONValue v)

Convert a std.json.JSONValue into the internal representation.

jsonEquals
bool jsonEquals(JsonNode a, JsonNode b)

Deep structural equality with JSON Schema number semantics: numbers compare by mathematical value across representations (1, 1u, and 1.0 are all equal), objects compare without regard to member order, arrays element-wise.

parseJson
JsonNode parseJson(string text)

Parse JSON text into a JsonNode. Object member order is preserved (duplicate keys: the last value wins, matching std.json and vibe.data.json). Integer literals that fit a long parse as integer, those that fit only a ulong as uinteger, anything larger (or with fraction/exponent) as floating.

toStdJson
JSONValue toStdJson(JsonNode n)

Render the internal representation as a std.json.JSONValue.

writeJson
void writeJson(JsonNode n, Sink sink)

Serialize a JsonNode to compact JSON text (object member order preserved).

Structs

JsonNode
struct JsonNode

A JSON value: null, boolean, number (signed / unsigned / floating), string, array, or object with preserved member order.