Skip to content

Commit 64b5a43

Browse files
committed
update Readme for new interop tests
1 parent 6727531 commit 64b5a43

2 files changed

Lines changed: 242 additions & 125 deletions

File tree

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,10 @@ value = lazy["response"]["data"][0]["id"].value
269269
status = lazy.dig("response", "data", "status").value
270270
status = lazy.dig("nonexistent", "path").value # => nil
271271
272+
# JSON pointer-style path access — navigate deeply nested structures
273+
# without decoding anything outside the path:
274+
id = lazy.dig("response", "data", 0, "id").value
275+
272276
# Repeated access uses cache (O(1) after first access):
273277
id1 = lazy["response"]["data"][0]["id"].value
274278
id2 = lazy["response"]["data"][0]["id"].value # Same object, no re-parse
@@ -801,7 +805,7 @@ File streaming uses **adaptive readahead with doubling strategy:**
801805
|-------|-------|---------|
802806
| `ArgumentError` | Invalid option or reserved tag number | `CBOR.encode(obj, invalid: true)` |
803807
| `RangeError` | Integer overflow or invalid length | Encoding bigint larger than wire allows |
804-
| `RuntimeError` | Malformed CBOR, depth exceeded, or unimplemented | Truncated buffer, nested too deep, indefinite-length |
808+
| `RuntimeError` | Malformed CBOR or depth exceeded | Truncated buffer, nested too deep |
805809
| `TypeError` | Type mismatch in registered tag or unknown source | Field is Array but schema expects String |
806810
| `KeyError` | Lazy map access to missing key | `lazy["nonexistent"]` (use `.dig` for safe access) |
807811
| `IndexError` | Lazy array out of bounds or invalid shared ref | `lazy[999]` on 3-item array |
@@ -823,12 +827,10 @@ Full RFC 8949 compliance. Official specification: https://tools.ietf.org/html/rf
823827

824828
Tested against:
825829

826-
- **Python:** `cbor2` library (comprehensive test suite via `interop.py`)
830+
- **Go:** `fxamacker/cbor` v2 in strict mode (preferred serialization, UTF-8 validation, duplicate key rejection) — 63/63 checks pass including wire-level byte equality for all scalar types. See `interop_go/`.
827831

828832
**RFC 8949 compliance:** This implementation strictly adheres to RFC 8949, so it should interoperate with any spec-compliant CBOR decoder in any language.
829833

830-
**Guaranteed portability via `symbols_as_string`:** If you use string-based symbols (Tag 39), your CBOR documents are readable by any RFC 8949-compliant decoder in any language.
831-
832834
### Test Vectors
833835

834836
Official RFC 8949 test vectors (Appendix A) included in `/test-vectors/`. Run:
@@ -848,7 +850,7 @@ Apache License 2.0. See [LICENSE](LICENSE) file.
848850

849851
## Contributing
850852

851-
Issues, PRs, and bug reports welcome. See `interop.py` for testing against other implementations.
853+
Issues, PRs, and bug reports welcome. See `interop_go/` for testing against Go's `fxamacker/cbor`.
852854

853855
---
854856

0 commit comments

Comments
 (0)