OKHAM.org Documentation EnglishCastellano

Release candidate 0.2.0-rc.2

OTC · JSON schema

Open original JSON

{
  "$defs": {
    "a11yHints": {
      "additionalProperties": false,
      "description": "Accessibility hints",
      "properties": {
        "description": {
          "description": "Screen reader description i18n key",
          "type": "string"
        },
        "invalid": {
          "description": "Announce as invalid",
          "type": "boolean"
        },
        "live": {
          "description": "ARIA live region type",
          "enum": [
            "off",
            "polite",
            "assertive"
          ],
          "type": "string"
        },
        "required": {
          "description": "Announce as required",
          "type": "boolean"
        },
        "role": {
          "description": "ARIA role",
          "type": "string"
        }
      },
      "type": "object"
    },
    "constraints": {
      "additionalProperties": false,
      "description": "Validation constraints",
      "properties": {
        "const": {
          "description": "Exact required value"
        },
        "enum": {
          "description": "Allowed values",
          "minItems": 1,
          "type": "array"
        },
        "exclusiveMaximum": {
          "description": "Exclusive maximum value",
          "type": "number"
        },
        "exclusiveMinimum": {
          "description": "Exclusive minimum value",
          "type": "number"
        },
        "format": {
          "description": "Format identifier",
          "enum": [
            "email",
            "uri",
            "url",
            "uuid",
            "date",
            "time",
            "date-time",
            "duration",
            "ipv4",
            "ipv6",
            "hostname",
            "phone",
            "credit-card",
            "iban",
            "bic"
          ],
          "type": "string"
        },
        "maxItems": {
          "description": "Maximum array length",
          "minimum": 0,
          "type": "integer"
        },
        "maxLength": {
          "description": "Maximum string length",
          "minimum": 0,
          "type": "integer"
        },
        "maximum": {
          "description": "Maximum numeric value",
          "type": "number"
        },
        "minItems": {
          "description": "Minimum array length",
          "minimum": 0,
          "type": "integer"
        },
        "minLength": {
          "description": "Minimum string length",
          "minimum": 0,
          "type": "integer"
        },
        "minimum": {
          "description": "Minimum numeric value",
          "type": "number"
        },
        "multipleOf": {
          "description": "Value must be multiple of this",
          "exclusiveMinimum": 0,
          "type": "number"
        },
        "nullable": {
          "description": "Field may be null",
          "type": "boolean"
        },
        "pattern": {
          "description": "Regex pattern for validation",
          "type": "string"
        },
        "required": {
          "description": "Field must be present",
          "type": "boolean"
        },
        "uniqueItems": {
          "description": "Array items must be unique",
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "field": {
      "additionalProperties": false,
      "properties": {
        "constraints": {
          "$ref": "#/$defs/constraints"
        },
        "default": {
          "description": "Default value for the field"
        },
        "description": {
          "description": "Field description",
          "type": "string"
        },
        "examples": {
          "description": "Example values",
          "items": {},
          "type": "array"
        },
        "hints": {
          "$ref": "#/$defs/hints"
        },
        "meaning": {
          "description": "Semantic meaning tag",
          "pattern": "^[a-z][a-z0-9]*\\.[a-zA-Z][a-zA-Z0-9]*$",
          "type": "string"
        },
        "name": {
          "description": "Field name in camelCase",
          "pattern": "^[a-z][a-zA-Z0-9]*$",
          "type": "string"
        },
        "required": {
          "description": "Whether field is required",
          "type": "boolean"
        },
        "type": {
          "description": "Primitive type or type reference",
          "oneOf": [
            {
              "enum": [
                "string",
                "integer",
                "number",
                "boolean",
                "array",
                "object",
                "null"
              ]
            },
            {
              "pattern": "^\\$ref:[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9]*){3,}$"
            }
          ],
          "type": "string"
        }
      },
      "required": [
        "name",
        "type"
      ],
      "type": "object"
    },
    "hints": {
      "additionalProperties": false,
      "description": "Non-normative hints for UI, i18n, a11y",
      "properties": {
        "a11y": {
          "$ref": "#/$defs/a11yHints"
        },
        "i18n": {
          "$ref": "#/$defs/i18nHints"
        },
        "privacy": {
          "$ref": "#/$defs/privacyHints"
        },
        "ui": {
          "$ref": "#/$defs/uiHints"
        }
      },
      "type": "object"
    },
    "i18nHints": {
      "additionalProperties": false,
      "description": "Internationalization hints",
      "properties": {
        "error": {
          "description": "Error message i18n key",
          "type": "string"
        },
        "help": {
          "description": "Help text i18n key",
          "type": "string"
        },
        "label": {
          "description": "Label i18n key",
          "type": "string"
        },
        "placeholder": {
          "description": "Placeholder i18n key",
          "type": "string"
        },
        "unit": {
          "description": "Unit label i18n key",
          "type": "string"
        }
      },
      "type": "object"
    },
    "privacyHints": {
      "additionalProperties": false,
      "description": "Privacy and sensitivity hints",
      "properties": {
        "audit": {
          "description": "Include in audit logs",
          "type": "boolean"
        },
        "mask": {
          "description": "Mask in logs and displays",
          "type": "boolean"
        },
        "retention": {
          "description": "Data retention policy",
          "enum": [
            "none",
            "session",
            "persistent"
          ],
          "type": "string"
        },
        "sensitivity": {
          "description": "Data sensitivity level",
          "enum": [
            "public",
            "internal",
            "pii",
            "secret"
          ],
          "type": "string"
        }
      },
      "type": "object"
    },
    "uiHints": {
      "additionalProperties": false,
      "description": "UI presentation hints",
      "properties": {
        "autocomplete": {
          "description": "HTML autocomplete attribute",
          "type": "string"
        },
        "group": {
          "description": "Field grouping identifier",
          "type": "string"
        },
        "hidden": {
          "description": "Hide from UI",
          "type": "boolean"
        },
        "inputType": {
          "description": "HTML input type",
          "enum": [
            "text",
            "email",
            "password",
            "number",
            "tel",
            "url",
            "date",
            "time",
            "datetime-local",
            "color",
            "file",
            "checkbox",
            "radio",
            "range",
            "hidden",
            "search"
          ],
          "type": "string"
        },
        "masked": {
          "description": "Mask input characters",
          "type": "boolean"
        },
        "multiline": {
          "description": "Use multi-line input",
          "type": "boolean"
        },
        "order": {
          "description": "Display order",
          "type": "integer"
        },
        "placeholder": {
          "description": "Placeholder text or i18n key",
          "type": "string"
        },
        "readonly": {
          "description": "Display as read-only",
          "type": "boolean"
        },
        "rows": {
          "description": "Rows for multiline input",
          "minimum": 1,
          "type": "integer"
        },
        "width": {
          "description": "Layout width hint",
          "enum": [
            "full",
            "half",
            "third",
            "quarter",
            "auto"
          ],
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "$id": "https://okham.org/schemas/otc/0.2.0/schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Unpublished 0.2.0 draft edition derived from the current OKHAM runtime catalogue. See the specification for semantic checks and coverage limits.",
  "properties": {
    "abstract": {
      "default": false,
      "description": "If true, type cannot be instantiated directly",
      "type": "boolean"
    },
    "deprecated": {
      "default": false,
      "description": "If true, type is deprecated",
      "type": "boolean"
    },
    "deprecatedReason": {
      "description": "Reason for deprecation",
      "type": "string"
    },
    "description": {
      "description": "Purpose description of the type",
      "minLength": 1,
      "type": "string"
    },
    "examples": {
      "description": "Example values",
      "items": {},
      "type": "array"
    },
    "extends": {
      "description": "Parent type ID to inherit from",
      "pattern": "^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9]*){3,}$",
      "type": "string"
    },
    "fields": {
      "description": "Field definitions",
      "items": {
        "$ref": "#/$defs/field"
      },
      "minItems": 1,
      "type": "array"
    },
    "id": {
      "description": "Unique namespaced type identifier",
      "pattern": "^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9]*){3,}$",
      "type": "string"
    },
    "implementations": {
      "description": "Language-specific bindings",
      "items": {
        "additionalProperties": true,
        "type": "object"
      },
      "type": "array"
    },
    "metadata": {
      "additionalProperties": true,
      "description": "Additional metadata",
      "type": "object"
    },
    "mixins": {
      "description": "Mixin type IDs for composition",
      "items": {
        "pattern": "^[a-z][a-z0-9]*(?:\\.[a-z][a-z0-9]*){3,}$",
        "type": "string"
      },
      "type": "array"
    },
    "name": {
      "description": "Human-readable type name",
      "maxLength": 100,
      "minLength": 1,
      "type": "string"
    },
    "otc": {
      "description": "OTC specification version",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
      "type": "string"
    },
    "schema": {
      "additionalProperties": true,
      "description": "JSON Schema representation",
      "type": "object"
    },
    "status": {
      "description": "Stability status",
      "enum": [
        "draft",
        "stable",
        "deprecated"
      ],
      "type": "string"
    },
    "tags": {
      "description": "Classification tags",
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "version": {
      "description": "Type version (semver)",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
      "type": "string"
    }
  },
  "required": [
    "otc",
    "id",
    "name",
    "description",
    "fields"
  ],
  "title": "OTC Type Definition",
  "type": "object",
  "x-okham-identity-edition": "User-authorized local identity amendment: global contract identifiers use authority.domain.kind.name with lowercase alphanumeric dot-separated segments. Existing format and artifact versions and schema URIs are preserved. This annotation identifies a local amendment, not a published standards release."
}