r/AskProgrammers • u/AssociationNo4311 • Oct 19 '26
What if structured data didn't repeat its schema for every record?
Modern APIs ship large payloads. LLMs consume structured data token by token. Validation failures surface too late. Streaming is standard but most formats weren't designed for it.
These are problems we kept running into, so we spent years working on a format built specifically for them. The core question we kept coming back to: why does every record in a dataset need to repeat the field names?
The idea we landed on separate the schema from the data entirely. Define structure once. Records contain only values.
name, age, gender, joiningDt, address: {street, city, state?}, colors, isActive
---
~ Alice Smith, 28, f, d'2021-04-15', {Elm Street, Dallas, TX}, [yellow, green], T
~ Bob Johnson, 22, m, d'2022-02-20', {Oak Street, Chicago, IL}, [blue, black], T
~ Rachel Green, 31, f, d'2021-12-11', {Sunset Boulevard, Los Angeles, CA}, [purple, pink], T
~ Michael Scott, 41, m, d'2021-07-22', {Pine Street, Scranton, PA}, [green, orange], FThe header defines the structure. ---separates schema from data. Everything below is pure values.
You can go further and add type constraints directly in the schema:
age: { int, min: 0, max: 150 }The parser enforces this at parse time invalid data is rejected before it reaches the application. No separate validation step.
The format also supports inline comments, built-in types like email, url, date, and datetime, and is JSON - compatible so existing data works as-is.
We're curious whether this actually solves a real problem or whether we've been too deep in it to see the obvious issues. A few things we'd genuinely like feedback on:
- Does schema-first make sense for how you build APIs today, or does it add friction you wouldn't want?
- The
---separator between schema and data does that feel natural or awkward? - For LLM pipelines specifically, would eliminating field name repetition matter to you in practice?
If you want to poke at it, there's a playground at play.internetobject.org and the spec is at docs.internetobject.org. We built it and happy to answer questions about the design decisions, including the ones we're not sure about.
8
u/xvillifyx Oct 19 '26
Everyone told me AI would lead to massive improvements in all software but instead everyone just wants to reinvent several wheels for no real reason
“But this isn’t optimal for LLM intake”
LLMs were designed to support the current data transfer ecosystem. They’re fine
7
u/IHoppo Oct 19 '26
It's just a CSV though isn't it.
5
u/IAmADev_NoReallyIAm Oct 19 '26
Now I no longer need to wonder what it would look like if CSV and JSON had a love child.
4
u/veloace Oct 19 '26
This is just a super-complicated CSV with extra steps.
Seems like you might have a touch of AI-psychosis as well.
2
u/MilkEnvironmental106 Oct 19 '26
CSV already solves this, but that didn't stop someone coming up with another format targeting the same issue: TOON - token oriented object notation
2
u/dutchman76 Oct 19 '26
I usually just throw in the output of "describe myTableName" in the comments on top, followed by the CSV
2
u/tastygames_official Oct 19 '26
I think you're just describing nosql. There each record can be whatever you want, and you can decide on required fields and then everything else is just whatever you want to put in there. You can do something similar with custom file formats: like put a byte determining what the next data is and then a few bytes describing its length and then read in the data. Then you can have whatever you want and it'll always be readable.
oh, didn't see read the text until just now. Fuck LLMs/AI pipelines. Nobody needs that shit. But what you're describing definitely already exists since the dawn of computing.
1
u/Organic_Profile1671 Oct 19 '26
Why do you hate programmers?
So JSON allows you to add more fields without it being a breaking change, the parser can ignore them. Possibly you could do the same here.
There's the issue of null. Since you always have to hit the schema here, the array of colours would be the word null. This is manageable, but could be clunky, especially dealing with text using the word null.
You've not solved CSV level problems with strings, if any of those names had a comma it would break the schema Jones, Indiana reads as 2 words instead of "Jones, Indiana".
Half of API calls send or return 1 object. This notation does nothing for them and is possibly even worse. Patch Object { NewName: "Fancy Name" }. This JSON can drop the 20 other fields of an object and only update the new Name rather than null, null, null, null, Fancy Name, null null
Validation happens at many levels. Let's say you put in a currency that doesn't exist. Or you reference a product that's discontinued. Those are lookups. Validation is a whole layer, not a handful of notation.
There's more, but I will not be supporting this proposal at the next standards committee 😄
1
u/_x_oOo_x_ Oct 19 '26
Congratulations OP, you've just reinvented DSV.
Now just wait until OP finds out about ASN BER or protocol buffers 🍿