GitHub API Response to Valibot

Paste any GitHub REST API JSON response and get a Valibot v.object instantly. Tree-shakes to only the primitives you use — handy for GitHub Actions runtimes, Cloudflare Workers, and CLI tools where bundle size matters.

JSON input valid
Valibot output

      
    

About this conversion

GitHub's REST API quietly evolves — fields appear as previews, get GA'd, occasionally vanish in API version bumps. Wrapping the call in a Valibot v.parse turns shape drift into a single named error at the boundary; you know exactly which field GitHub didn't send and decide to fail closed or fall back. Generated from the JSON shape you paste, the schema captures only the fields your code actually reads, so unused surface area stays out.

The output is a copy-paste-runnable v.object using the canonical namespace import (import * as v from "valibot"). Drop it into a GitHub Action (where Valibot's per-primitive tree-shaking saves boot time on every run), a Cloudflare Worker, or a CLI tool. Each merged response array becomes a single schema; missing fields across samples become v.optional(...); nullable fields become v.union with v.null() — mirroring the shape rules of the Zod-mode sibling, so you can A/B between the two ecosystems without reasoning about semantic drift.

Same shape, other validators

Other JSON shapes