{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://objectsgrid.com/.well-known/objects-catalog/DefinedTerm/v1/schema.json",
  "title": "DefinedTerm",
  "description": "Objects Grid DefinedTerm Object. One coded term of a DefinedTermSet, such as one error code of your API with its explanation: what happened, the usual causes, how to fix it, in every language you support. Its id is the code, chosen by you, so a lookup is a plain read; termCode repeats it. internalNotes are for your support team: the default policy hides them from anonymous callers. Modeled in compliance with https://schema.org/DefinedTerm.",
  "type": "object",
  "properties": {
    "at_context": {
      "description": "Schema context",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "https://schema.org"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "at_type": {
      "description": "The object type",
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "DefinedTerm"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "at_id": {
      "description": "This DefinedTerm's ObjectsGrid URL, https://apis.objectsgrid.com/<path>/<id>: its JSON-LD @id, which References point to. Set by the service.",
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "readOnly": true
    },
    "id": {
      "description": "The DefinedTerm's id, chosen by you: for an error code, the code itself, e.g. ORDER_LOCKED",
      "type": "string",
      "pattern": "^[A-Za-z0-9][A-Za-z0-9_-]{0,49}$"
    },
    "identifier": {
      "description": "The DefinedTerm's id. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "readOnly": true
    },
    "url": {
      "description": "This DefinedTerm URL. Assigned by the server.",
      "type": [
        "string",
        "null"
      ],
      "format": "uri",
      "minLength": 1,
      "readOnly": true
    },
    "termCode": {
      "description": "The code, as your API returns it: the id. Set by the service.",
      "type": [
        "string",
        "null"
      ],
      "readOnly": true
    },
    "inDefinedTermSet": {
      "description": "The set it belongs to",
      "x-objectsgrid-rangeIncludes": [
        "DefinedTermSet"
      ],
      "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Reference/v1/schema.json"
    },
    "name": {
      "description": "The term, or the error's title, e.g. The order is locked",
      "type": "array",
      "minItems": 1,
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "description": {
      "description": "What it means, or what happened",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "mainEntityOfPage": {
      "description": "Your page about it, e.g. https://docs.example.com/errors/ORDER_LOCKED",
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "causes": {
      "description": "The usual causes, one entry per cause and language. ObjectsGrid's own field.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      },
      "maxItems": 50
    },
    "remedy": {
      "description": "How to fix it. ObjectsGrid's own field.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "httpStatus": {
      "description": "The HTTP status your API answers with it, for an error. ObjectsGrid's own field.",
      "type": [
        "integer",
        "null"
      ],
      "minimum": 100,
      "maximum": 599
    },
    "seeAlso": {
      "description": "Further reading. ObjectsGrid's own field.",
      "type": [
        "array",
        "null"
      ],
      "maxItems": 20,
      "items": {
        "type": "string",
        "format": "uri"
      }
    },
    "supportContact": {
      "description": "Who to ask about it. ObjectsGrid's own field.",
      "anyOf": [
        {
          "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ContactPoint/v1/schema.json"
        },
        {
          "type": "null"
        }
      ]
    },
    "internalNotes": {
      "description": "Notes for your support team, never for your API's callers: the default policy hides them from anonymous callers. ObjectsGrid's own field.",
      "type": [
        "array",
        "null"
      ],
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/LanguageTaggedString/v1/schema.json"
      }
    },
    "tags": {
      "description": "Tags an ABAC policy can decide on. A name may repeat; the same name and value appear once. Every stored object has them: created empty when not sent, kept by a replacement (PUT) that does not mention them, unchanged by a patch that does not mention them, cleared by null or [].",
      "type": "array",
      "default": [],
      "uniqueItems": true,
      "maxItems": 50,
      "items": {
        "$ref": "https://objectsgrid.com/.well-known/objects-catalog/Tag/v1/schema.json"
      }
    },
    "meta": {
      "description": "System-managed metadata for the object (version, audit fields). Assigned by the server.",
      "$ref": "https://objectsgrid.com/.well-known/objects-catalog/ObjectMeta/v1/schema.json",
      "readOnly": true
    }
  },
  "required": [
    "id",
    "inDefinedTermSet",
    "name"
  ],
  "unevaluatedProperties": false
}
