{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://3rdpersona.com/spec/constraint.schema.json",
  "title": "A constraint as it travels in a packet",
  "type": "object",
  "additionalProperties": false,
  "required": ["text", "applies"],
  "properties": {
    "text": {"type": "string", "minLength": 1, "maxLength": 500},
    "applies": {"enum": ["action", "disclosure"]},
    "terms": {"type": "array", "items": {"type": "string", "minLength": 1, "maxLength": 120}},
    "until": {"type": "string", "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}
  }
}
