PartialJson

Streaming-safe partial-JSON repair + parse operations. Grouped into an object so the helpers stay file-local members rather than loose top-level functions.

Since

0.3.0-beta01

Functions

Link copied to clipboard
fun fixJson(input: String): String

Complete a partial/truncated JSON string so Json.parseToJsonElement can read it. Returns "" when nothing valid was scanned (e.g. a lone -). See parsePartialJson for the parse wrapper.

Link copied to clipboard

Parse possibly-partial JSON. Mirrors Vercel AI SDK v6 parsePartialJson: