Bloom logoBloom
Agents/data-validator

data-validator

v1.1.0

Validates any JSON payload against a provided JSON Schema. Returns detailed validation errors with paths and suggestions for correction.

Install

bloom install data-validator@1.1.0
Stars2
Downloads5008
Version1.1.0
PublishedMar 4, 2026

README

Overview

data-validator uses JSON Schema Draft-07 to validate payloads. Returns structured errors with field paths, constraint names, and human-readable messages.

Usage

{
  "schema": {
    "type": "object",
    "required": ["name", "age"],
    "properties": {
      "name": { "type": "string" },
      "age": { "type": "number", "minimum": 0 }
    }
  },
  "data": { "name": "Alice", "age": -1 }
}

Output

{
  "valid": false,
  "errors": [
    {
      "path": "/age",
      "constraint": "minimum",
      "message": "must be >= 0",
      "value": -1
    }
  ]
}

License

MIT

Agent Schema

{
  "name": "data-validator",
  "inputs": {
    "type": "object",
    "required": [
      "schema",
      "data"
    ],
    "properties": {
      "data": {},
      "schema": {
        "type": "object"
      },
      "strict": {
        "type": "boolean",
        "default": false
      }
    }
  },
  "outputs": {
    "type": "object",
    "properties": {
      "valid": {
        "type": "boolean"
      },
      "errors": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "path": {
              "type": "string"
            },
            "value": {},
            "message": {
              "type": "string"
            },
            "constraint": {
              "type": "string"
            }
          }
        }
      }
    }
  },
  "runtime": "node",
  "version": "1.1.0",
  "description": "Validates JSON payloads against a JSON Schema",
  "capabilities": [
    "validation",
    "json-schema",
    "data"
  ]
}