Skip to main content

validate-a-json-payload

Validate a JSON payload against syntax, schema, semantic invariants, size, encoding, and privacy requirements. Use when data crosses an API, queue, file, webhook, or storage boundary.

Source facts

Repository
protosphinx/sphinxstack
Last source activity
July 29, 2026 at 13:55
Detected SKILL.md language
English
Stars
3
Forks
0

Install options

The review-first prompt is selected by default. You can switch to a direct command or download a local copy.

Review the source files

Read SKILL.md and any companion files shown by SkillsMP before deciding whether to install.

File Explorer
2 files

Showing SKILL.md

SKILL.md
Source instructions · Read-only preview
name
validate-a-json-payload
category
code
description
Validate a JSON payload against syntax, schema, semantic invariants, size, encoding, and privacy requirements. Use when data crosses an API, queue, file, webhook, or storage boundary.
# validate-a-json-payload Valid JSON syntax does not prove valid domain data. ## When to use - Use before accepting, emitting, migrating, replaying, or debugging JSON. - Do not log secrets or personal data merely to explain validation failure. ## Preconditions - Obtain the payload safely, schema and version, boundary rules, size limits, and expected semantics. ## Procedure 1. Preserve a redacted sample and source metadata. 2. Check bytes, encoding, syntax, duplicate-key policy, depth, and size. 3. Validate required fields, types, enums, formats, ranges, nullability, and additional fields. 4. Apply semantic invariants across fields and referenced entities. 5. Check version compatibility, defaults, coercion, unknown-field, and numeric precision behavior. 6. Return bounded field errors without echoing sensitive values. 7. Test valid, boundary, malformed, oversized, adversarial, and old-version cases. ## Failure plan - Quarantine rather than partially process a payload whose required semantics are unresolved. ## Worked example A syntactically valid payment event fails because amount is negative, currency and minor units disagree, and an unknown version would be coerced silently. ## Done - A JSON validation report records schema version, syntax, field, semantic, compatibility, privacy, and size results - Boundary, malformed, adversarial, precision, unknown-field, and redaction tests verify safe handling
View on GitHub