{
  "$comment": "generated by canon-docs, do not edit",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://beyond10x.github.io/canon/schemas/properties-1.schema.json",
  "title": "canon-properties/1",
  "description": "A `canon-properties/1` document as written.",
  "$ref": "#/$defs/Properties",
  "$defs": {
    "Identifier": {
      "description": "A well-formed identifier is not empty, and without whitespace, control characters or Unicode format characters (general category Cf). The pattern checks only for whitespace; Canon also refuses control and Unicode format characters.",
      "type": "string",
      "minLength": 1,
      "pattern": "^\\S+$"
    },
    "Properties": {
      "description": "A `canon-properties/1` document as written.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "format": {
          "description": "The document format; `canon check` accepts only `canon-properties/1`.",
          "type": "string",
          "const": "canon-properties/1"
        },
        "protocol": {
          "description": "The id of the protocol the properties are about; `canon check` refuses another.",
          "$ref": "#/$defs/Identifier"
        },
        "properties": {
          "description": "The properties, keyed by identifier. A property declared twice is refused.",
          "type": "object",
          "propertyNames": {
            "$ref": "#/$defs/Identifier"
          },
          "additionalProperties": {
            "$ref": "#/$defs/Property"
          }
        }
      },
      "required": [
        "format",
        "protocol"
      ]
    },
    "Property": {
      "description": "One property: its subject's status is the same in every two states that agree on everything except the evidence the `independent_of` claim reads.",
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "description": {
          "type": "string"
        },
        "subject": {
          "description": "The action or outcome whose status the property is about.",
          "$ref": "#/$defs/PropertySubject"
        },
        "independent_of": {
          "description": "What the subject's status must not depend on.",
          "$ref": "#/$defs/PropertyDependency"
        }
      },
      "required": [
        "subject",
        "independent_of"
      ]
    },
    "PropertySubject": {
      "description": "What a property is about. Written as a map with exactly one of the keys `action` or `outcome`.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "action": {
              "description": "The action's status: `admissible`, `approval-required` or `blocked`.",
              "$ref": "#/$defs/Identifier"
            }
          },
          "required": [
            "action"
          ]
        },
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "outcome": {
              "description": "The outcome's status: `legitimate` or `blocked`.",
              "$ref": "#/$defs/Identifier"
            }
          },
          "required": [
            "outcome"
          ]
        }
      ]
    },
    "PropertyDependency": {
      "description": "What a property's subject must not depend on. Written as a map with the one key `claim`.",
      "oneOf": [
        {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "claim": {
              "description": "The claim, standing for the evidence it reads, by kind and subject, directly or through the claims it tests.",
              "$ref": "#/$defs/Identifier"
            }
          },
          "required": [
            "claim"
          ]
        }
      ]
    }
  }
}
