alasdairforsythe

Simple and high-performance JSON decoder for Go, designed for fast & easy API response parsing

11
2
100% credibility
Found May 13, 2026 at 11 stars -- GitGems finds repos before they trend. Get early access to the next one.
Sign Up Free
AI Analysis
Go
AI Summary

jsondec is a Go library offering a faster, more secure alternative to standard JSON decoding with features like required fields, presence and null detection, forbidden fields, size limits, and union types.

How It Works

1
💭 Spot data handling headaches

You're making an app that gets info from users, but the regular way lets missing details slide by or can't spot empty vs missing parts.

2
🔍 Discover jsondec

You find jsondec, a smarter helper that reads incoming info bundles safely, spotting must-haves and blocking surprises.

3
📦 Add it to your project

You simply bring jsondec into your work with one easy step, and it's ready to use.

4
✏️ Set your info rules

You sketch out what your incoming info should look like, flagging required pieces, optional ones, and even forbidden extras for extra safety.

5
Build your speedy reader

You create a personal, super-fast tool just for your info type that works perfectly every time without slowing down.

6
📥 Read incoming info anytime

Whenever new info arrives, you hand it to your reader and get back exactly what you expect, clean and quick.

🎉 App runs smooth and secure

Now your app handles all user data flawlessly, staying fast, safe from tricks, and free of nasty surprises.

Sign up to see the full architecture

5 more

Sign Up Free

Star Growth

See how this repo grew from 11 to 11 stars Sign Up Free
Repurpose This Repo

Repurpose is a Pro feature

Generate ready-to-use prompts for X threads, LinkedIn posts, blog posts, YouTube scripts, and more -- with full repo context baked in.

Unlock Repurpose
AI-Generated Review

What is jsondec?

jsondec is a Go JSON decoder for fast API response parsing, fixing stdlib gaps like silent zeroing of missing fields, no presence detection, and lacking null-vs-absent distinction. You register a decoder once per struct type at startup—using simple tags for required fields, forbidden keys, or unions—and reuse it with zero reflection overhead. It adds security limits on size/depth and raw JSON preservation, all via user-friendly types like OptionalNullable[string] for full PATCH semantics.

Why is it gaining traction?

It crushes encoding/json in benchmarks—2.5x-4.5x faster, fewer allocs—while beating json/v2 on some fixtures and trading blows with goccy/go-json. Devs love the struct tags for required fields, jsondecodeerror details with paths like "order.items[2].price", and features like forbidden fields or StringOrSlice unions that stdlib ignores. No more wrapper types or custom UnmarshalJSON for production pains like oversized payloads or privilege escalations.

Who should use this?

Go backend devs building API servers with untrusted inputs, especially those implementing PATCH endpoints needing absent/null/value distinction. Teams parsing GitHub webhooks, OpenAPI schemas, or configs where structural limits prevent DoS. Suited for high-throughput services like order processing or log ingestion over simple CRUD.

Verdict

Grab it for perf-critical JSON decoding if stdlib's gaps bite you—docs are thorough, errors actionable, benchmarks legit—but 11 stars and 1.0% credibility signal early maturity; test thoroughly for your payloads before prod.

(198 words)

Sign up to read the full AI review Sign Up Free

Similar repos coming soon.