TYPE010warningPro

unsafe-json-parse

JSON parsing with type assertion lacks runtime validation

Applies to: Go, Python, Ruby, Rust, TypeScript

Why this matters

Type assertions only affect compile-time checking. At runtime, JSON parsing returns unvalidated data, and if it doesn't match your expected type, you'll get confusing errors when you try to use missing properties. Use zod/pydantic for runtime validation.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, TYPE010 includedstablestack explain TYPE010

TYPE010 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: TYPE010