update
This commit is contained in:
24
docs/spec.md
24
docs/spec.md
@@ -306,6 +306,7 @@ When `transport = "link"`, the `data` field contains a URL pointing to the uploa
|
||||
| Platform | Input Type | Serialization | Encoding |
|
||||
|----------|------------|---------------|----------|
|
||||
| All | `Vector{Dict}`/`Array<Object>` | JSON array | Base64 or direct JSON |
|
||||
| Desktop | `pandas.DataFrame` | JSON array | Base64 or direct JSON |
|
||||
|
||||
### Binary Serialization
|
||||
|
||||
@@ -642,13 +643,20 @@ flowchart TD
|
||||
|
||||
### Unit Test Validation
|
||||
|
||||
| Test | Input | Expected Output |
|
||||
|------|-------|-----------------|
|
||||
| Text round-trip | `("msg", "Hello", "text")` | `("msg", "Hello", "text")` |
|
||||
| Dictionary round-trip | `("data", {"key": "value"}, "dictionary")` | `("data", {"key": "value"}, "dictionary")` |
|
||||
| Arrow table round-trip | `("table", DataFrame(...), "arrowtable")` | `("table", DataFrame(...), "arrowtable")` |
|
||||
| Mixed payloads | `[("text", "Hello", "text"), ("img", bytes, "image")]` | `[("text", "Hello", "text"), ("img", bytes, "image")]` |
|
||||
| Large payload | `("data", rand(10_000_000), "arrowtable")` | `("data", URL, "arrowtable")` with link transport |
|
||||
| Test | Input | Expected Output | Notes |
|
||||
|------|-------|-----------------|-------|
|
||||
| Text round-trip | `("msg", "Hello", "text")` | `("msg", "Hello", "text")` | String serialization |
|
||||
| Dictionary round-trip | `("data", {"key": "value"}, "dictionary")` | `("data", {"key": "value"}, "dictionary")` | JSON object round-trip |
|
||||
| Arrow table round-trip | `("table", arrow_table_data, "arrowtable")` | `("table", arrow_table_data, "arrowtable")` | Arrow IPC round-trip |
|
||||
| JSON table round-trip | `("table", [{"a":1},{"b":2}], "jsontable")` | `("table", [{"a":1},{"b":2}], "jsontable")` | JSON array of objects |
|
||||
| Mixed payloads | `[("text", "Hello", "text"), ("img", bytes, "image")]` | `[("text", "Hello", "text"), ("img", bytes, "image")]` | Multiple payload types |
|
||||
| Large payload | `("data", rand(10_000_000), "arrowtable")` | `("data", URL, "arrowtable")` with link transport | File server upload |
|
||||
|
||||
**Platform-Specific Notes:**
|
||||
- **Julia**: Use `Dict`, `Vector{Dict}`, or convert `DataFrame` to dictionary for testing
|
||||
- **Python**: Use `dict`, `list[dict]`, or convert `pandas.DataFrame` to dictionary for testing
|
||||
- **JavaScript**: Use plain objects `{}` and arrays `[]`
|
||||
- **MicroPython**: Use plain `dict` and `list` (limited to JSON table and text types)
|
||||
|
||||
### Integration Test Scenarios
|
||||
|
||||
@@ -658,6 +666,8 @@ flowchart TD
|
||||
| Python ↔ Julia | Arrow table | Arrow IPC round-trip |
|
||||
| JavaScript ↔ Python | Mixed content | All payloads preserved |
|
||||
| Large file transfer | All platforms | File server upload/download |
|
||||
| Cross-platform JSON table | All platforms | Dictionary array round-trip |
|
||||
| MicroPython ↔ Desktop | Text, dictionary only | Limited payload types |
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user