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.

来源信息

仓库
protosphinx/sphinxstack
最近来源活动
2026年7月29日 13:55
检测到的 SKILL.md 语言
英语
星标
3
Forks
0

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
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
在 GitHub 查看