Commit Graph

26 Commits

Author SHA1 Message Date
Johann Schopplich
e02c3aae3a chore: release v2.1.0 2025-12-04 22:34:07 +01:00
Johann Schopplich
690e402a6b chore: release v2.0.1 2025-11-27 22:07:47 +01:00
Johann Schopplich
5310e8ae3d chore: release v2.0.0 2025-11-24 17:45:42 +01:00
Johann Schopplich
05abb99a7e feat!: standardized encoding for list-item objects (spec v3) 2025-11-24 14:40:36 +01:00
Johann Schopplich
2b2e26b0ef chore: release v1.4.0 2025-11-24 08:42:50 +01:00
Johann Schopplich
327bddae55 feat: parse nested tabular arrays in list items with bare hyphen (spec v2.1) 2025-11-24 08:42:30 +01:00
Johann Schopplich
8d9b486485 chore: release v1.3.0 2025-11-21 22:38:59 +01:00
Johann Schopplich
cfbbb09358 chore: release v1.2.0 2025-11-21 14:03:40 +01:00
Johann Schopplich
be8bcfe9b2 chore: release v1.1.0 2025-11-21 09:36:25 +01:00
Johann Schopplich
36ddd2e0ea fix: encode mixed-format arrays at root level (fixes #202) 2025-11-21 09:01:26 +01:00
Johann Schopplich
4b4f7c05f9 docs: add dedicated docs website 2025-11-18 07:23:10 +01:00
Johann Schopplich
2e7a27c3c0 chore: upgrade tsdown 2025-11-11 09:31:17 +01:00
Johann Schopplich
b2782b026f chore: release v1.0.0 2025-11-10 17:29:05 +01:00
Johann Schopplich
e8ae024e54 feat!: remove optional length marker option [#N] in favor of [N] 2025-11-10 17:28:49 +01:00
Johann Schopplich
4f5000b2eb chore: release v0.9.0 2025-11-10 10:51:36 +01:00
Johann Schopplich
89b227302a fix(path-expanding): overwrite with new value 2025-11-10 10:51:12 +01:00
Johann Schopplich
acca69c64a chore(benchmarks): replace LLM-as-judge, new structural validation 2025-11-07 21:28:21 +01:00
Johann Schopplich
9863875706 chore: release v0.8.0 2025-11-05 19:04:20 +01:00
Johann Schopplich
840626dc90 feat: minor fixes for spec v1.4 compliance 2025-11-05 19:04:00 +01:00
Johann Schopplich
314497630d chore: release v0.7.3 2025-11-03 17:42:01 +01:00
Johann Schopplich
3fc9291a8f chore: release v0.7.2 2025-11-03 11:41:37 +01:00
Johann Schopplich
f08376ca04 chore: release v0.7.1 2025-11-03 08:23:13 +01:00
Wind
e414ca3671 fix: handle empty list items and nested objects in list items (#65)
* fix: support quoted keys with array syntax

Fixes parsing of quoted keys followed by array syntax like:
"x-codeSamples"[1]{lang,label,source}:

Previously, parseArrayHeaderLine would skip any line starting with
a quoted key. This caused large OpenAPI specs (like Hetzner Cloud API)
to fail decoding.

Changes:
- Modified parseArrayHeaderLine to handle quoted keys
- Added logic to find bracket start after closing quote
- Unescape quoted keys properly
- Added 3 test cases for the new functionality

Closes #62

* fix: handle empty list items and nested objects in list items

This commit fixes two critical decoder bugs that prevented complex
OpenAPI specs (like DigitalOcean's 638 schemas) from being decoded:

1. Empty list items: Items encoded as just `-` (without space) were
   not recognized. The decoder only checked for `LIST_ITEM_PREFIX = '- '`.
   Fixed by adding check for both `- ` and `-` patterns.

2. Nested objects in list items: When a list item contains an object
   with nested properties (e.g., `allOf[2]: - properties: state: ...`),
   the decoder was looking for nested content at the wrong depth level.
   List items add one level of indentation, so nested content should be
   at baseDepth + 2, not baseDepth + 1.

   Fixed by creating `decodeKeyValueForListItem()` that correctly handles
   the extra nesting while maintaining proper followDepth for siblings.

Changes:
- Added `decodeKeyValueForListItem()` function to handle list item nesting
- Updated `decodeObjectFromListItem()` to use new function
- Added empty item detection in `decodeListArray()`
- Added comprehensive unit tests for both bugs
- Added integration test with real DigitalOcean OpenAPI spec (638 schemas)
- Gitignored large fixture files, added README with download instructions

Tests:
- 5 new unit tests in list-item-bugs.test.ts
- 1 integration test in digitalocean-decode.test.ts (skips if fixture missing)
- All 309 existing tests still pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* perf: calculate depth on demand

* chore: move tests to test suite

* chore: test against new tests

---------

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Johann Schopplich <mail@johannschopplich.com>
2025-11-03 08:18:14 +01:00
Johann Schopplich
8977c8c7d6 feat: use language-agnostic test suite 2025-11-02 18:31:06 +01:00
Johann Schopplich
da0a0b9be3 chore: release v0.7.0 2025-11-01 17:28:24 +01:00
Johann Schopplich
0710bd19e7 feat!: publish to @toon-format/toon and @toon-format/cli 2025-11-01 16:53:41 +01:00