JSON Payloads & Schema Engineering
JavaScript Object Notation (JSON) is the standard UTF-8 text format for structured payloads over HTTP APIs and WebSocket text frames.
1. RFC 8259 Data Types
| Type | Syntax | Example |
|---|---|---|
| Object | Key-value map with double-quoted keys | {"ok": true} |
| Array | Ordered list of values | [1, 2, 3] |
| String | Double-quoted UTF-8 text | "hello" |
| Number | Base-10 integer or float | 42, 3.14 |
2. Typed WebSocket Envelopes
{
"type": "telemetry.tick",
"seq": 1042,
"payload": { "status": "healthy", "rttMs": 14.2 }
}
3. NDJSON Line-Delimited Streaming
{"seq":1,"event":"connected"}
{"seq":2,"event":"subscribed","topic":"status"}