<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jop</title>
    <description>The latest articles on DEV Community by Jop (@_904affc0d58589ee2ac5).</description>
    <link>https://dev.to/_904affc0d58589ee2ac5</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3913909%2Fa3b97278-af9b-403f-ad2a-f96c050f6a75.jpg</url>
      <title>DEV Community: Jop</title>
      <link>https://dev.to/_904affc0d58589ee2ac5</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/_904affc0d58589ee2ac5"/>
    <language>en</language>
    <item>
      <title>Why ChatGPT sucks at generating Types (and how I fixed it)</title>
      <dc:creator>Jop</dc:creator>
      <pubDate>Sat, 30 May 2026 14:00:00 +0000</pubDate>
      <link>https://dev.to/_904affc0d58589ee2ac5/why-chatgpt-sucks-at-generating-types-and-how-i-fixed-it-4did</link>
      <guid>https://dev.to/_904affc0d58589ee2ac5/why-chatgpt-sucks-at-generating-types-and-how-i-fixed-it-4did</guid>
      <description>&lt;p&gt;Have you ever pasted a JSON payload into ChatGPT and asked it to generate a TypeScript interface or Go struct? &lt;/p&gt;

&lt;p&gt;Usually, it works. But sometimes, it decides to be "helpful" and changes your &lt;code&gt;user_id&lt;/code&gt; to &lt;code&gt;UserId&lt;/code&gt;, or completely forgets an optional field. In a production CI/CD pipeline, this kind of AI hallucination is a nightmare. &lt;/p&gt;

&lt;p&gt;I got tired of this, so I built &lt;strong&gt;&lt;a href="https://typeflow.pro" rel="noopener noreferrer"&gt;TypeFlow&lt;/a&gt;&lt;/strong&gt;: A developer tool that converts JSON, SQL, or YAML into 16+ languages instantly. But the real secret isn't just AI—it's a &lt;strong&gt;Hybrid Architecture&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Problem: AI is smart, but unpredictable
&lt;/h2&gt;

&lt;p&gt;When dealing with Data Transfer Objects (DTOs), schemas, and type definitions, you need &lt;strong&gt;100% deterministic output&lt;/strong&gt;. If an AI "guesses" a type wrong, your app crashes.&lt;/p&gt;

&lt;p&gt;Legacy tools like QuickType are fully deterministic but feel outdated and struggle with broken syntax. Modern devs just use AI, but sacrifice reliability. &lt;/p&gt;

&lt;h2&gt;
  
  
  The Solution: The Hybrid "TypeFlow" Engine
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F40cp8zrr0tg1iz6q7kqv.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F40cp8zrr0tg1iz6q7kqv.gif" alt=" " width="559" height="263"&gt;&lt;/a&gt;&lt;br&gt;
I wanted the absolute reliability of a compiler, mixed with the "magic" of an LLM. Here is how I built the TypeFlow engine:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. The Core: Pure AST Parsing (Zero AI)
&lt;/h3&gt;

&lt;p&gt;When you paste JSON or SQL into TypeFlow, it doesn't go to an LLM. Instead, I wrote a custom parser that reads the input and builds a &lt;strong&gt;Unified Abstract Syntax Tree (AST)&lt;/strong&gt; entirely in the browser. &lt;br&gt;
From that single AST, the engine deterministically generates 16 different outputs (TypeScript, Python Pydantic, Go Structs, Rust, Swift, etc.) in &lt;code&gt;0.01&lt;/code&gt; seconds. &lt;br&gt;
&lt;strong&gt;Result:&lt;/strong&gt; Zero hallucinations. 100% reliable types.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. The Magic: AI for Semantics and Healing
&lt;/h3&gt;

&lt;p&gt;If the core is pure logic, where does the AI come in? I used the &lt;strong&gt;Gemini API&lt;/strong&gt; for the things logic &lt;em&gt;can't&lt;/em&gt; do easily:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Schema Healing:&lt;/strong&gt; If you paste broken JSON (missing commas, trailing brackets), the AI intercepts it, heals the syntax instantly, and passes it to the AST parser.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Semantic Zod Validation:&lt;/strong&gt; AST parsers just see &lt;code&gt;string&lt;/code&gt;. I added an AI feature that reads the context of your data and infers semantic rules, automatically generating &lt;code&gt;z.string().email()&lt;/code&gt; or &lt;code&gt;z.string().uuid()&lt;/code&gt; for Zod validation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mermaid ER Diagrams:&lt;/strong&gt; The AI reads the AST structure and generates beautiful Mermaid database relationship diagrams in real-time.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  The Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Frontend:&lt;/strong&gt; Next.js 14 (App Router) + TailwindCSS&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Editor:&lt;/strong&gt; Monaco Editor (VS Code engine in the browser)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AI:&lt;/strong&gt; Gemini 2.5 Flash (Using Server-Sent Events &lt;code&gt;alt=sse&lt;/code&gt; for real-time code streaming)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Hosting:&lt;/strong&gt; Cloudflare Pages (Blazing fast global edge delivery)&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Try it out!
&lt;/h2&gt;

&lt;p&gt;I just launched the beta version. It's completely free to use right now.&lt;br&gt;
Check it out here: &lt;strong&gt;&lt;a href="https://typeflow.pro" rel="noopener noreferrer"&gt;TypeFlow.pro&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let me know what you think! Have you experienced AI hallucinations breaking your code before? Drop a comment below!👇&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
