Added
- Full TOON v3.0 specification compliance
- Global helper functions:
toon_encode()andtoon_decode() - Spec-compliant string quoting (strings with special characters are now quoted with
"...") - Proper escape sequences within quoted strings (
\n,\r,\t,\",\\) - Delimiter support: comma (default), tab (
\t), and pipe (|) viadelimiterconfig option - Strict mode for decoding with validation errors via
strictconfig option - Key folding: collapse single-key nested objects into dot notation via
key_foldingconfig - Path expansion: expand dotted keys back to nested objects via
expand_pathsconfig - Inline primitive array format (
key[N]: a,b,c) - Official specification test fixtures from toon-format/spec
Changed
- BREAKING: String escaping now uses quoted strings instead of backslash escaping
- Before:
message: Hello\, World\: Test - After:
message: "Hello, World: Test"
- Before:
- BREAKING: Removed
escape_styleconfig option (no longer applicable) - Float encoding now preserves full IEEE 754 double precision (16 significant digits)
Migration Guide
The decoder maintains backward compatibility and parses both old backslash-escaped format and new quoted strings.
If you have code that expects the old output format:
- Encoded output now uses quoted strings for special characters
- Republish config:
php artisan vendor:publish --tag=toon-config --force - Set
strict => falseif parsing legacy TOON with formatting issues