Optional schema validation system for type-safe data handling #127
Replies: 3 comments 1 reply
-
Beta Was this translation helpful? Give feedback.
-
|
Hi there, thanks for the initial PR! Well done. 👏 I like the idea of having some kind of schema validation built into the format itself. Having said that, to keep the format lean and implementations across languages feasable, the feature requires some back and forth in the spec first. Planning-wise, I'd love to have: Finally, we can overhaul the TS implementation. Most importantly, I have some concers over the current implementation:
Regarding your questions:
I'd prefer a clean and simple interface for the initial version that the other ports (Python, etc.) can jump on without too much of a hassle. |
Beta Was this translation helpful? Give feedback.
-
|
Hello,
I will directly work on it and adapt your suggestions to my fPR.
Best regards
Hermann
Hermann del Campo
Managing Director & CTO
Mobile: +49 160 553 80 13
E-Mail: ***@***.***
Raiva Technologies UG (haftungsbeschränkt)
C/o UFA
Dianastraße 21
14482 Potsdam
Germany
Managing Director: Carsten Probst, Hermann del Campo
Registration Court: AG Potsdam
Registration number: in progress
VAT number: in progress
Am 14.11.2025 um 13:12 schrieb Johann Schopplich ***@***.***>:
Sie erhalten nicht häufig E-Mails von ***@***.*** Erfahren Sie, warum dies wichtig ist<https://aka.ms/LearnAboutSenderIdentification>
Hi there, thanks for the initial PR! Well done. 👏
I like the idea of having some kind of schema validation built into the format itself. Having said that, to keep the format lean and implementations across languages feasable, the feature requires some back and forth in the spec<https://github.com/toon-format/spec> first.
Planning-wise, I'd love to have:
1️⃣ an RFC first in the spec repo<https://github.com/toon-format/spec>,
2️⃣ accompanied with comformance tests that can be used across languages.
Finally, we can overhaul the TS implementation. Most importantly, I have some concers over the current implementation:
* I'd prefer Standard Schema<https://github.com/standard-schema/standard-schema> instead of a custom validation engine. That would enable users to use Zod/Valibot etc. Dunno how that works well for TOON in other languages, tho.
* Tests should be part of the conformance test suite.
…________________________________
Regarding your questions:
1. Syntax preferences: Is @Schema is plain and simple, I like it.
2. Validation levels: strict and lenient feels like a good place to start.
3. Inline schemas for simpler parsing for now.
4. Depends on the spec version. We could keep it opt-in during v2 and enable it by default for v3.
5. A structured list.
I'd prefer a clean and simple interface for the initial version that the other ports (Python, etc.) can jump on without too much of a hassle.
—
Reply to this email directly, view it on GitHub<#127 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/BZN4JLFP33AYX2PW2IHVUXT34XBMRAVCNFSM6AAAAACMBLXYL2VHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTIOJWHEYDANI>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey TOON community! 👋
I've been working with TOON in production and loving the token savings, but I kept running into situations where I needed type validation and better self-documentation for LLMs. So I prototyped a schema validation system that I'd love to get your feedback on!
The Idea
Add optional schema definitions to TOON that provide:
Proposed Syntax
Instead of repeating field names 100 times, we define them once! The schema also helps LLMs understand the data structure without additional prompting.
🧪 Early Results
I've built a working prototype and the results are promising:
Questions for You
Syntax preferences: Is
@schemaintuitive? Would you prefer something else?Validation levels: Should we support:
Schema location: Where should schemas live?
.toon-schemafilesDefault behavior: Should validation be:
validateOnEncode: trueError format: What's most useful?
Features to add/remove:
@validate("price > 0"))@schema Admin extends User)fullName = firstName + lastName)Your Thoughts?
Really excited to hear what everyone thinks! TOON has been game-changing plattform, happy found it 2 weeks ago and I think schemas could make it even better.
Let me know if you love it, hate it, or have ideas to make it better! All feedback welcome 🙏
My PR: #126
Beta Was this translation helpful? Give feedback.
All reactions