360 Secure SkillHub
360 安全技能中心

Datagate

DataGate 以本地 Python 服务形式提供 JSON 校验接口:提交 JSON Schema(Draft 2020-12)与待校验数据,返回是否有效、错误数量,以及每条违规的字段路径与说明;schema 本身非法时返回指向 $schema 的错误而不崩溃,便于多智能体流水线在传递数据前做校验。

分类:数据
mirni
mirni
热度 31.58
最近更新 2026-05-11 17:42:41

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add mirni/datagate
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
datagate
description
Validate JSON data against a JSON Schema (Draft 2020-12). Post a schema and payload, get back whether it's valid plus detailed error paths and messages for every violation. Language-agnostic validation gate for multi-agent pipelines.
metadata
{"openclaw":{"emoji":"✅","requires":{"bins":["python"]},"install":[{"id":"pip","kind":"uv","packages":["fastapi","uvicorn","pydantic","jsonschema"]}]}}

DataGate

Validate any JSON payload against a JSON Schema.

Start the server

uvicorn datagate.app:app --port 8004

Validate data

curl -s -X POST http://localhost:8004/v1/validate \
  -H "Content-Type: application/json" \
  -d '{
    "json_schema": {
      "type": "object",
      "properties": {"name": {"type": "string"}, "age": {"type": "integer", "minimum": 0}},
      "required": ["name", "age"]
    },
    "payload": {"name": "Alice", "age": 30}
  }' | jq

Returns valid (true/false), error_count, and errors (each with path pointing to the exact field and message explaining the violation).

Handles invalid schemas too

If you send a broken schema, DataGate catches it and returns an error pointing to $schema with a clear message. No crashes.

Use case

Agents passing data between services can validate payloads before sending. Non-Python agents get Pydantic-grade validation via a simple API call.