Add plain JSON string encoding entry points (encodeJson) and docs/tests (v0.1.1) #4
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces convenience overloads to encode plain JSON strings directly to TOON, updates documentation with examples, centralizes JSON parsing, and adds tests. Version is bumped to 0.1.1.
Motivation
JsonNodefirst.JToonby delegating to a centralized utility.Changes
JToon.encodeJson(String json): StringJToon.encodeJson(String json, EncodeOptions options): StringJsonNormalizer.parse(String)with consistent validation and error handling.EncodeOptions(indent, delimiter, lengthMarker)encodeJson, including Java text block usage.API
JToon:encodeJson(String json)encodeJson(String json, EncodeOptions options)JsonNormalizer.parse(String)and encoding toValueEncoder.encodeValue(...).Behavior and Validation
IllegalArgumentExceptionfromJsonNormalizer.parse(String).encode(...)of equivalent structures.Breaking Changes
Documentation
Encode a plain JSON stringexample and explains delimiter options and length markers in context.encodeJsonoverloads.Testing
build/reports/tests/test.Versioning
Migration Guide
encode(JsonNode)with the new entry points:Checklist
Summary by CodeRabbit
New Features
encodeJson()methods to encode JSON strings directly to TOON format with optional encoding options and input validation.Documentation
Tests