Skip to content

JSON Schema in TOON Format #123

@woutervancgi

Description

@woutervancgi

When TOON would fully implement JSON Schema we can make TOON DRY; repeating items can be implemented once and used as reference, this makes TOON even more compact.

Current implementation

Pattern TOON vs YAML Reason
Reused schemas 🔴 20-30x larger No anchors/aliases - must inline everything
allOf with base schemas 🔴 2-3x larger Base schema copied multiple times
Error responses 🔴 30x larger Same error schema repeated ~30 times
Nested object properties 🔴 2-5x larger Cannot use references
Deeply nested structures 🔴 3-4x larger All nesting must be explicit
Primitive enums ✅ ~10% smaller Inline format wins
Tabular arrays ✅ 40-60% smaller (But only if no nested objects!)

Proposal to address these

As JSON is widely in use and mature as Object Notation format, using all the lessons learned form JSON in TOON can help maturing it quickly.
So to help in this transition and the implementation process I have converted JSON Schema Draft 2020-12 into TOON with the help of Claude Sonnet 4.5.

json-schema-toon-spec.toon.txt
json-schema-toon-spec.html
json-schema-toon-spec.md

I have run multiple tests, please review it as well.
Let me know if you endorse this approach and like to move this way forward.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions