Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- §7.1 ABNF `unescaped-char`: supplementary scalars (`%x10000-10FFFF`) included explicitly.
- §13: option names and value tokens are concept handles; implementations MAY use language-idiomatic spellings or types.
- Appendix F.5: informative Java mapping section.
- Test fixtures: nested expanded arrays containing empty object list items, confirming recursive bare-hyphen encoding/decoding per §9.4/§10.

### Changed

Expand Down
10 changes: 10 additions & 0 deletions tests/fixtures/decode/arrays-nested.json
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@
"expected": ["summary", { "id": 1, "name": "Ada" }, [{ "id": 2 }, { "status": "draft" }]],
"specSection": "9.4"
},
{
"name": "parses nested arrays with empty object list items",
"input": "items[2]:\n - [1]:\n -\n - [2]:\n - x\n -",
"expected": {
"items": [[{}], ["x", {}]]
},
"specSection": "9.4",
"minSpecVersion": "3.2",
"note": "The bare hyphen marker for an empty object list item applies recursively inside nested expanded arrays"
},
{
"name": "parses root-level array of arrays",
"input": "[2]:\n - [2]: 1,2\n - [0]:",
Expand Down
10 changes: 10 additions & 0 deletions tests/fixtures/encode/arrays-nested.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@
"expected": "[3]:\n - summary\n - id: 1\n name: Ada\n - [2]:\n - id: 2\n - status: draft",
"specSection": "9.4"
},
{
"name": "encodes nested arrays with empty object list items as bare hyphen",
"input": {
"items": [[{}], ["x", {}]]
},
"expected": "items[2]:\n - [1]:\n -\n - [2]:\n - x\n -",
"specSection": "9.4",
"minSpecVersion": "3.2",
"note": "Nested non-primitive arrays use expanded list form per §9.4; empty object list items inside them still encode as a bare hyphen per §10, with no trailing space per §12"
},
{
"name": "encodes root-level arrays of arrays",
"input": [[1, 2], []],
Expand Down