-
Notifications
You must be signed in to change notification settings - Fork 19
Toon Spec 3.0 #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Toon Spec 3.0 #23
Conversation
…ansion.cs` - Replaced dot (.) with `Constants.DOT` in `PathExpansion.cs` - Added `ToonPathExpansionException` - Updated spec generator aligned to v3.0.0
Co-authored-by: Johann Schopplich <[email protected]>
This reverts commit f3c8e11.
…r copied from the SpecGen project
|
I'm expected to be available for revisions on Friday. |
No problem, I figured this downtime I had would be a great time to get this library up to spec and resolve the conflicts we had |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR implements full compliance with TOON Specification v3.0, introducing critical bug fixes for encoding/decoding Section 10 list items with tabular arrays, comprehensive path expansion functionality (Section 13.4), improved number formatting to eliminate scientific notation, and updated project-wide namespace standardization from ToonFormat to Toon.Format. The implementation now passes 521 tests with 100% spec coverage.
Key Changes:
- Fixed Section 10 encoding/decoding for objects with arrays as first fields in list items (depth adjustments from +1 to +2)
- Added path expansion support with
ToonPathExpansionenum andToonPathExpansionExceptionfor dotted key handling - Improved number formatting to output canonical decimal form without scientific notation per SPEC v3.0 §2
Reviewed changes
Copilot reviewed 72 out of 72 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
README.md |
Comprehensive documentation overhaul with API examples, type conversion tables, and feature descriptions |
src/ToonFormat/Constants.cs |
Added XML documentation and ToonPathExpansion enum for path expansion control |
src/ToonFormat/ToonPathExpansionException.cs |
New exception type for path expansion conflicts with detailed error context |
src/ToonFormat/Internal/Encode/Encoders.cs |
Fixed Section 10 compliance: tabular rows and array contents now appear at depth +2 on hyphen lines |
src/ToonFormat/Internal/Decode/Decoders.cs |
Fixed Section 10 decoding: arrays as first field decode at effective depth +2, added quoted key tracking |
src/ToonFormat/Internal/Decode/PathExpansion.cs |
New path expansion logic for dotted keys with conflict detection and LWW resolution |
src/ToonFormat/Internal/Encode/Primitives.cs |
Added FormatNumber method to eliminate scientific notation in number output |
src/ToonFormat/Internal/Shared/NumericUtils.cs |
New utility for converting doubles to canonical decimal form |
tests/ToonFormat.Tests/**/*.cs |
Updated namespaces from ToonFormat.Tests to Toon.Format.Tests |
tests/ToonFormat.SpecGenerator/**/*.cs |
Updated namespaces, improved error handling in GitTool, added test cleanup logic |
specgen.sh, specgen.ps1 |
Updated to generate against TOON v3.0.0 spec and output to GeneratedTests directory |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
johannschopplich
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the effort!
|
It seems to me that this branch can now be merged? |
Yes sir. |
|
Happy holidays and welcome back @toon-format/dotnet-maintainers ! Let's start the new year with being 3.0 compliant! LGTM! |
Linked Issue
Closes #17 #9 #7 #8
Description
This PR implements full compliance with TOON Specification v3.0, including critical bug fixes, test improvements, and comprehensive documentation updates. The implementation now passes all 521 tests (100% pass rate, 0 skipped) with complete specification coverage and is production-ready for .NET 8.0, 9.0 and 10.0
This incorporates changes from #17 while cleaning up code to ensure proper compilation and test validation
Type of Change
Changes Made
This pull request introduces major improvements to the project's documentation, brings the codebase into full alignment with the TOON Specification v3.0, and enhances decoding logic for strict spec compliance and usability. The README now provides comprehensive usage instructions, API documentation, and feature details, reflecting the project's production-ready status. Additionally, the decoding internals have been refactored to better support quoted keys and array decoding per spec requirements, and obsolete float converters have been removed.
Documentation and Project Status Updates:
README.mdto include detailed usage examples, API documentation, installation instructions, type conversion tables, delimiter/key folding/path expansion options, and explicit project status. The documentation now reflects full TOON v3.0 spec compliance and production readiness. [1] [2]specgen.ps1,specgen.sh) to generate tests against TOON Specification v3.0 and output to a newGeneratedTestsdirectory, ensuring alignment with the latest spec. [1] [2]Core Library Improvements:
Constantsclass and introduced theToonPathExpansionenum for improved path expansion control in decoding. [1] [2]Decoders.csto:Codebase Simplification:
DoubleNamedFloatToNullConverter.cs,SingleNamedFloatToNullConverter.cs) as this logic is now handled elsewhere or is no longer needed. [1] [2]SPEC Compliance
Conformance Checklist Status (Section 13.1 & Section 13.2)
Encoder Compliance:
Decoder Compliance:
Testing
Pre-submission Checklist
Breaking Changes
Additional Context