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": {
    "jsonValue": {
      "type": ["null", "boolean", "number", "string", "array", "object"]
    },
    "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"},
        "nin": {"type": "array"},
        "contains": {"$ref": "#/$defs/jsonValue"},
        "starts_with": {"type": "string"},
        "ends_with": {"type": "string"},
        "exists": {"type": "boolean"}
      }
    },
    "expression": {
      "type": "object",
      "minProperties": 1,
      "propertyNames": {
        "anyOf": [
          {"enum": ["$and", "$or", "$not"]},
          {"type": "string", "pattern": "^/"}
        ]
      },
      "properties": {
        "$and": {
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "#/$defs/expression"}
        },
        "$or": {
          "type": "array",
          "minItems": 1,
          "items": {"$ref": "#/$defs/expression"}
        },
        "$not": {"$ref": "#/$defs/expression"}
      },
      "additionalProperties": {"$ref": "#/$defs/fieldPredicate"}
    }
  }
}