Parse JSON string

Parse JSON string in JavaScript — with the four heights of help laid out: do it now, make it easier for the next person to accept, work out the right move when you are stuck, and learn the pattern so it stops coming back.

4prompt heights
Open it in the interactive atlas →

The four heights

The same task, four distances: today's deadline, the next reviewer, the stuck moment, the pattern.

Execute — do the immediate task

+
I have a webhook that receives a JSON payload from Stripe and sometimes throws when the body is…
I have a webhook that receives a JSON payload from Stripe and sometimes throws when the body is malformed. Parse the incoming body string into an object, validate the required fields customer_id and amount exist and are numbers, and if parsing fails respond 400 with a clear message so the caller can fix it.

Improve — make it easier to accept

+
Before I send this webhook handler to the ops team, make the payload validation easy to audit:…
Before I send this webhook handler to the ops team, make the payload validation easy to audit: place the parse and schema check at the top, surface the exact offending key and value, and call out where optional fields could be abused. Flag any try/catch that swallows errors without a 400 response.

Decide — diagnose the stuck moment

+
A Stripe webhook started failing for some customers; the handler throws a SyntaxError when…

A webhook crashed with SyntaxError parsing JSON

A Stripe webhook started failing for some customers; the handler throws a SyntaxError when JSON.parse runs and I return 500 to Stripe. I don’t know if the problem is bad data from Stripe or an upstream proxy mangling the body. What is the most likely cause and the safest immediate change so we return a helpful 400 and log the raw body for debugging?

Become — change the pattern

+
Every few weeks a third-party webhook arrives with broken JSON and I end up adding ad hoc fixes for…

Repeated parsing errors from external payloads

Every few weeks a third-party webhook arrives with broken JSON and I end up adding ad hoc fixes for each case. This wastes time and leaves us exposed. What process and simple code pattern should I make standard so incoming JSON is parsed defensively, validated against a schema, and incidents surface actionable debug info without leaking PII?

Next to this one

Other programming language work people do in JavaScript.

Every task here came from the work, not from a feature list — which is why the prompts name what you want done and never the button that does it. The tool changes; the work does not.
Copyright © LLOS.ai · 2026 — original pedagogy, voice, and design — all rights reserved.

The rest of the map

Same library, five ways in.