rostack_v1 / 2026-08-13 / draft

filter.schema.json

Machine-readable JSON artifact.

json{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://spec.pmh.codes/apis/rostack_v1/releases/2026-08-13/schemas/filter.schema.json",
  "title": "rostack_v1 filter",
  "$ref": "#/$defs/expression",
  "$defs": {
    "jsonScalar": {
      "oneOf": [
        {"type": "null"},
        {"type": "boolean"},
        {"type": "number"},
        {"type": "string"}
      ]
    },
    "jsonValue": {
      "oneOf": [
        {"$ref": "#/$defs/jsonScalar"},
        {"type": "array", "items": {"$ref": "#/$defs/jsonScalar"}}
      ]
    },
    "fieldPredicate": {
      "type": "object",
      "minProperties": 1,
      "additionalProperties": false,
      "properties": {
        "eq": {"$ref": "#/$defs/jsonValue"},
        "ne": {"$ref": "#/$defs/jsonValue"},
        "gt": {"$ref": "#/$defs/jsonValue"},
        "gte": {"$ref": "#/$defs/jsonValue"},
        "lt": {"$ref": "#/$defs/jsonValue"},
        "lte": {"$ref": "#/$defs/jsonValue"},
        "in": {"type": "array", "items": {"$ref": "#/$defs/jsonScalar"}},
        "nin": {"type": "array", "items": {"$ref": "#/$defs/jsonScalar"}},
        "contains": {"$ref": "#/$defs/jsonValue"},
        "starts_with": {"type": "string"},
        "ends_with": {"type": "string"},
        "exists": {"type": "boolean"}
      }
    },
    "expression": {
      "type": "object",
      "minProperties": 1,
      "properties": {
        "$and": {
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "#/$defs/expression"}
        },
        "$or": {
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "#/$defs/expression"}
        },
        "$not": {"$ref": "#/$defs/expression"}
      },
      "patternProperties": {
        "^/": {"$ref": "#/$defs/fieldPredicate"}
      },
      "unevaluatedProperties": false
    }
  }
}