COPYABLE FIXTURE
A2UI v0.9 JSONL example.
This three-message stream creates a surface, supplies data, and then defines a small component graph. Each line is a complete JSON object, which makes it suitable for streaming transports and line-oriented logs.
{"version":"v0.9","createSurface":{"surfaceId":"profile","catalogId":"https://a2ui.org/specification/v0_9/catalogs/basic/catalog.json","sendDataModel":true}}
{"version":"v0.9","updateDataModel":{"surfaceId":"profile","path":"/user","value":{"name":"Ada Lovelace","role":"Engineer"}}}
{"version":"v0.9","updateComponents":{"surfaceId":"profile","components":[{"id":"root","component":"Column","children":["title","role"]},{"id":"title","component":"Text","text":{"path":"/user/name"}},{"id":"role","component":"Text","text":{"path":"/user/role"}}]}}
Message 1: create the surface
createSurface establishes the globally unique surface ID and selects the component catalog. Later updates reuse the same surfaceId. The optional sendDataModel flag asks the client to include the current model in relevant messages back to the server.
Message 2: populate the data model
The path /user replaces or creates that node with a normal JSON object. Sending data before components is valid after the surface exists. A renderer can hold the state until bound components arrive.
Message 3: define the graph
The component list is flat. The root Column references two Text nodes by ID. Their text values bind to JSON Pointer paths in the surface data model. A production catalog determines the exact component properties and binding types available.
How to adapt the example
- Use a surface ID that is unique within your renderer session.
- Replace the catalog identifier with the catalog your client supports.
- Keep secrets and personal data out of debugging fixtures.
- Add components in later messages when testing progressive rendering.
- Run the complete output through lifecycle and catalog validation before rendering.