Valid JSON can still break your app: two-stage validation in a Prompt-to-VR engine
Friiman_Tech · reddit · 2026-12-02
A developer shares lessons from building a Prompt-to-VR engine:
- Problem: a long scene description came back with one bad ID near the end—the expensive generation was done, but the engine couldn't bind that entity to anything
- Two-layer solution:
- Constrain the IDs the model can return with a strict output schema for scene composition
- Run a second check on the parsed scene—valid JSON can still omit an asset the game needs; send the omission back into the scene's existing session for repair
- For free-form fields, keep the returned payload and use Pydantic field errors to explain what needs fixing
- He invites discussion on which errors to rule out at generation time vs. checking against the whole project
- Source on GitHub; FAQ covers the Quest result and creativity questions
More from coding & agent
- Fable-generated Metroidvania platformer impresses with fluid movement and scene quality — op7418 · 2026-12-06
- Team bets on iLands agent economy with stakes to counter closed-loop collapse — profjamesevans · 2026-12-06
- Running but dead: a 2-minute TCP watchdog for services restart policies can't save — petrusenko_max · 2026-12-06
- 20 Useful Hermes Plugins Across Work, Life, Creative, and Money, Curated From ~3,000 — alexcovo_eth · 2026-12-06
- Perplexity Teammates: 1M+ automations in first month, already 20% of credit revenue — inductionheads · 2026-12-06
- I built 60+ business automations. 38 of 63 survived — here's what the winners did differently — Beautiful-Radish-624 · 2026-12-06