Skip to content

GST-23: Introduction to TOON Format in Java#19172

Open
jdereg wants to merge 2 commits intoeugenp:masterfrom
jdereg:GST-23-toon-format
Open

GST-23: Introduction to TOON Format in Java#19172
jdereg wants to merge 2 commits intoeugenp:masterfrom
jdereg:GST-23-toon-format

Conversation

@jdereg
Copy link

@jdereg jdereg commented Mar 4, 2026

Summary

  • Add code samples for the article "Introduction to TOON Format in Java" (GST-23)
  • Demonstrates TOON (Token-Optimized Object Notation) serialization/deserialization using json-io 4.97.0
  • Includes token counting comparison between JSON and TOON formats using jtokkit

Changes

  • json-modules/json-3/pom.xml — added json-io 4.97.0 and jtokkit 1.1.0 dependencies
  • Person.java, Employee.java — simple POJOs used in examples
  • ToonSerializationUnitTest.java — 8 tests covering:
    • Single object serialization (key-value format)
    • Collection serialization (tabular format)
    • Pretty-print mode (expanded format)
    • Nested structures with recursive tabular optimization
    • Deserialization (TOON → Java objects, TOON → Map)
    • Token efficiency comparison (TOON vs JSON)

Test plan

  • mvn test -pl json-modules/json-3 -Dtest=ToonSerializationUnitTest

🤖 Generated with Claude Code

jdereg and others added 2 commits March 3, 2026 19:13
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Aligns code samples with updated Baeldung article: bumps json-io from
4.97.0 to 4.98.0 and switches token counting from CL100K_BASE (GPT-4)
to O200K_BASE (GPT-4o) encoding.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant