agentsclimarketplace

Json schema validator

Skill baronguyen001/ai-automation-skills/skills/json-schema-validator

Validate a dict/JSON payload against a useful subset of JSON Schema (type, required, properties, items, enum, min/max, length) with zero dependencies, returning readable errors. Use when the user wants to validate a webhook payload, API response, or config against a schema, or gate bad data before processing - without adding the jsonschema package.From its SKILL.md

Install
npx -y skills add baronguyen001/ai-automation-skills --skill json-schema-validator

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

SKILL.md

2.6 KB, 582 tokens by cl100k_base, as published. Nobody here has run it

JSON Schema Validator (zero-dep)

Use this skill to gate untrusted JSON - a webhook body, an API response, a config file - before your pipeline acts on it, without pulling in the jsonschema package. It walks a schema subset (type, required, properties, items, enum, minimum/maximum, minLength/maxLength) and returns a list of human-readable error strings, so you can log exactly what was wrong and skip the bad record instead of crashing three functions deep.

When to invoke

  • User says: "validate this payload", "check the webhook body matches a schema", "reject malformed records", "validate config against a schema".
  • A pipeline ingests external JSON and currently trusts its shape.

When NOT to invoke

  • You need full Draft 2020-12 features ($ref, allOf, patternProperties, formats) - install jsonschema.
  • The data is already typed by a model layer (e.g. Pydantic) - validate there.

Concrete example

User input:

Only accept events shaped like {type: str in [buy,sell], amount: number >= 0}.

Output:

# Copy assets/validate.py into your project, then:
from validate import validate, is_valid

schema = {
    "type": "object",
    "required": ["type", "amount"],
    "properties": {
        "type": {"enum": ["buy", "sell"]},
        "amount": {"type": "number", "minimum": 0},
    },
}

errors = validate({"type": "hold", "amount": -3}, schema)
# ["$.type: 'hold' not in enum ['buy', 'sell']", "$.amount: -3 < minimum 0"]
if not is_valid(event, schema):
    skip(event)

Errors carry a JSON-path-ish location ($.amount, $.items[2].id) so logs point straight at the bad field.

Pattern to apply

  1. Check type first; on a mismatch, stop descending (deeper checks would be noise).
  2. Accumulate errors instead of raising, so one pass reports every problem.
  3. Treat bool as distinct from int/number - a common JSON validation bug.
  4. Use it as a gate: if not is_valid(...): skip/quarantine before any side effects.

Reference: assets/validate.py.

Source

Distilled from webhook + API-ingestion work in the author's automations. v1.0.0. See also: [[webhook-receiver]], [[env-config-loader]], [[pipeline-orchestrator]].

→ Build the full runnable bot with Trawlkit.

What ships with it: 1 file

2.9 KB alongside SKILL.md, 1 of them executable

assets/

Keep looking

Skills are one crate of 326,851. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.