Skip to content

Instantly share code, notes, and snippets.

View jesty's full-sized avatar

Davide Cerbo jesty

View GitHub Profile
@jesty
jesty / JsonFixer.java
Created April 22, 2026 16:40
Fix an incomplete JSON to easily stream AI json responses
package com.example.demo;
import java.util.ArrayDeque;
import java.util.Deque;
public class JsonFixer {
public String fix(String response) {
String json = findJson(response);
if (json == null || json.isEmpty()) {