Expand description
A surface’s data model: a JSON value addressed by JSON Pointers (RFC 6901),
with the rules every A2UI SDK shares (the specification’s conformance suite,
core/data_model.yaml):
- Empty segments collapse, so
//a///b//,/a/b/, and/a/bare one path;""and/are the root.~1unescapes to/before~0to~. nullreads as absent, and writing through it creates the containers.- A write creates missing containers: an array when the next segment is an
index, else an object. Array indices are canonical (no leading zeros), at
most
MAX_ARRAY_INDEX; writing past the end pads withnull. - Writing through a string, number, or boolean is an error, as is a non-numeric segment on an array.
__proto__,constructor, andprototypeare refused as segments in every SDK, whatever its language, so models move between them unchanged.- A watcher is notified when the value at its own path changed: a write to an ancestor, the path, or a descendant that left it the same notifies no one.
Structs§
- Data
Error - A data model operation the model or the user cannot do.
- Data
Model - A surface’s data model.
- WatchId
- An id for one watch, so the same path can be watched twice.
Constants§
- MAX_
ARRAY_ INDEX - The largest array index a write may use.
Functions§
- normalize
- A path in its normal form: segments collapsed and re-escaped,
/for the root. - pointer
- The JSON Pointer for segments (
/for none). - resolve
- Resolve
pathagainst a context path: an absolute path (starting with/) stands alone; a relative one, inside a template, extends the context;""and.are the context itself. - segments
- The segments of a JSON Pointer, unescaped, with empty segments dropped. Refuses the forbidden segments.