{
  "description": "This is the interface description of @ObjectModel.",
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://sap.github.io/csn-interop-specification/spec-v1/object-model.schema.json#",
  "title": "ObjectModel Document",
  "type": "object",
  "definitions": {
    "@ObjectModel.compositionRoot": {
      "type": "boolean",
      "default": true,
      "description": "Entity is the root of a compositional hierarchy.",
      "x-extension-targets": [
        "Entity"
      ],
      "title": "@ObjectModel.compositionRoot"
    },
    "@ObjectModel.representativeKey": {
      "description": "In case of multiple key elements: key element which represents the entity (in the sense that the entity itself is the list of values for this key element)",
      "x-extension-targets": [
        "Entity",
        "Service"
      ],
      "x-ref-to-doc": {
        "title": "Element Reference",
        "ref": "#/definitions/ElementReference"
      },
      "title": "@ObjectModel.representativeKey",
      "$ref": "#/definitions/ElementReference"
    },
    "@ObjectModel.semanticKey": {
      "type": "array",
      "description": "The entity contains element(s) which shall be used to display the key in UIs (instead of the technical key).",
      "x-extension-targets": [
        "Entity"
      ],
      "items": {
        "x-ref-to-doc": {
          "title": "Element Reference",
          "ref": "#/definitions/ElementReference"
        }
      },
      "title": "@ObjectModel.semanticKey"
    },
    "@ObjectModel.custom": {
      "type": "boolean",
      "description": "Indicates whether the annotated element or entity is a custom element.\nIf set to true, it is a custom element (field, entity, service, etc.).\nIf undefined or set to false, it is not defined whether it is a custom element.\n\nIf applied to an entity or service, everything that it contains is also considered custom.",
      "x-extension-targets": [
        "Type",
        "Entity",
        "Service"
      ],
      "x-introduced-in-version": "1.0.6",
      "title": "@ObjectModel.custom"
    },
    "@ObjectModel.modelingPattern": {
      "type": "object",
      "description": "The property declares the modeling pattern applied in this entity definition.",
      "x-extension-targets": [
        "Entity",
        "Service"
      ],
      "properties": {
        "#": {
          "type": "string",
          "description": "Provide the value in `{ \"#\": \"<value>\" }` enum notation.",
          "oneOf": [
            {
              "const": "DATA_STRUCTURE"
            },
            {
              "const": "LANGUAGE_DEPENDENT_TEXT"
            },
            {
              "const": "UNIT_CONVERSION_RATE"
            },
            {
              "const": "VALUE_HELP_PROVIDER"
            },
            {
              "const": "COLLECTIVE_VALUE_HELP"
            },
            {
              "const": "DERIVATION_FUNCTION"
            },
            {
              "const": "PARENT_CHILD_HIERARCHY_NODE_PROVIDER"
            },
            {
              "const": "ENTERPRISE_SEARCH_PROVIDER"
            },
            {
              "const": "TRANSACTIONAL_INTERFACE"
            },
            {
              "const": "TRANSACTIONAL_QUERY"
            },
            {
              "const": "ANALYTICAL_QUERY"
            },
            {
              "const": "ANALYTICAL_DOCUMENT_STORE"
            },
            {
              "const": "ANALYTICAL_CUBE"
            },
            {
              "const": "ANALYTICAL_DIMENSION"
            },
            {
              "const": "ANALYTICAL_FACT"
            },
            {
              "const": "ANALYTICAL_PARENT_CHILD_HIERARCHY_NODE"
            },
            {
              "const": "ANALYTICAL_KPI"
            },
            {
              "const": "OUTPUT_FORM_DATA_PROVIDER"
            },
            {
              "const": "OUTPUT_EMAIL_DATA_PROVIDER"
            },
            {
              "const": "OUTPUT_PARAMETER_DETERMINATION_DATA_SOURCE"
            },
            {
              "const": "SITUATION_ANCHOR"
            },
            {
              "const": "SITUATION_TRIGGER"
            },
            {
              "const": "SITUATION_DATACONTEXT"
            },
            {
              "const": "EXTERNAL_DATA_PROVIDER"
            },
            {
              "const": "NONE"
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "#"
      ],
      "examples": [
        {
          "#": "DATA_STRUCTURE"
        }
      ],
      "title": "@ObjectModel.modelingPattern"
    },
    "@ObjectModel.supportedCapabilities": {
      "type": "array",
      "description": "The property declares the supported usage type for this entity in the context of consuming data models.",
      "x-extension-targets": [
        "Entity",
        "Service"
      ],
      "items": {
        "$ref": "#/definitions/@ObjectModel.SupportedCapabilities_EnumValue"
      },
      "title": "@ObjectModel.supportedCapabilities"
    },
    "@ObjectModel.foreignKey.association": {
      "description": "The element is of type `cds.Association` which points to the list of values.\n\nUse only for service internal associations. For cross service associations, use the [@EntityRelationship Vocabulary](./entity-relationship) instead.",
      "x-extension-targets": [
        "Type"
      ],
      "x-ref-to-doc": {
        "title": "Element Reference",
        "ref": "#/definitions/ElementReference"
      },
      "title": "@ObjectModel.foreignKey.association",
      "$ref": "#/definitions/ElementReference"
    },
    "@ObjectModel.text.element": {
      "type": "array",
      "description": "The property contains element(s) containing a text for the annotated (id)element",
      "x-extension-targets": [
        "Type"
      ],
      "items": {
        "x-ref-to-doc": {
          "title": "Element Reference",
          "ref": "#/definitions/ElementReference"
        }
      },
      "examples": [
        [
          "BillingDocumentTypeName"
        ]
      ],
      "title": "@ObjectModel.text.element"
    },
    "@ObjectModel.text.association": {
      "description": "The element is of type cds.association, which points to an entity containing (language-dependent) texts for the annotated (id) element",
      "x-extension-targets": [
        "Type"
      ],
      "x-ref-to-doc": {
        "title": "Element Reference",
        "ref": "#/definitions/ElementReference"
      },
      "title": "@ObjectModel.text.association",
      "$ref": "#/definitions/ElementReference"
    },
    "@ObjectModel.tenantWideUniqueName": {
      "type": "string",
      "description": "Unique technical name of the entity within the tenant / isolation context it is deployed to.\nThis may be used as a hint for database table names and help to keep them short enough.\n\nOnce chosen the technical name ID MUST be kept stable (immutable).",
      "maxLength": 120,
      "x-extension-targets": [
        "Entity"
      ],
      "x-introduced-in-version": "1.0.3",
      "title": "@ObjectModel.tenantWideUniqueName"
    },
    "@ObjectModel.usageType.sizeCategory": {
      "type": "object",
      "description": "The size category enables the consumer to judge the possible result data set size.\nIt is a pure estimation at design time while modeling the entity what the data set size would be at runtime.\nIt reflects the set of data which has to be searched through to compute for example a count(*) of the data.\n\nThe labels correspond to the following size categories (expected number of rows at production customers):\n- S: less than 1000\n- M: less than 100.000\n- L: less than 10.000.000\n- XL: less than 100.000.000\n- XXL: more than 100.000.000",
      "properties": {
        "#": {
          "type": "string",
          "description": "Provide the value in `{ \"#\": \"<value>\" }` enum notation.",
          "oneOf": [
            {
              "const": "S",
              "description": "Small: less than 1000 rows expected at production customers."
            },
            {
              "const": "M",
              "description": "Medium: less than 100.000 rows expected at production customers."
            },
            {
              "const": "L",
              "description": "Large: less than 10.000.000 rows expected at production customers."
            },
            {
              "const": "XL",
              "description": "Extra large: less than 100.000.000 rows expected at production customers."
            },
            {
              "const": "XXL",
              "description": "Extra extra large: more than 100.000.000 rows expected at production customers."
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "#"
      ],
      "x-extension-targets": [
        "Entity"
      ],
      "examples": [
        {
          "#": "XL"
        }
      ],
      "title": "@ObjectModel.usageType.sizeCategory"
    },
    "@ObjectModel.SupportedCapabilities_EnumValue": {
      "title": "Supported Capabilities Enum Value",
      "type": "object",
      "properties": {
        "#": {
          "type": "string",
          "description": "The entry declares one supported usage type.",
          "oneOf": [
            {
              "const": "SQL_DATA_SOURCE"
            },
            {
              "const": "CDS_MODELING_DATA_SOURCE"
            },
            {
              "const": "CDS_MODELING_ASSOCIATION_TARGET"
            },
            {
              "const": "DATA_STRUCTURE"
            },
            {
              "const": "LANGUAGE_DEPENDENT_TEXT"
            },
            {
              "const": "UNIT_CONVERSION_RATE"
            },
            {
              "const": "VALUE_HELP_PROVIDER"
            },
            {
              "const": "COLLECTIVE_VALUE_HELP"
            },
            {
              "const": "EXTRACTION_DATA_SOURCE"
            },
            {
              "const": "DERIVATION_FUNCTION"
            },
            {
              "const": "PARENT_CHILD_HIERARCHY_NODE_PROVIDER"
            },
            {
              "const": "SEARCHABLE_ENTITY"
            },
            {
              "const": "ENTERPRISE_SEARCH_PROVIDER"
            },
            {
              "const": "TRANSACTIONAL_PROVIDER"
            },
            {
              "const": "ANALYTICAL_QUERY"
            },
            {
              "const": "ANALYTICAL_DOCUMENT_STORE"
            },
            {
              "const": "ANALYTICAL_DIMENSION"
            },
            {
              "const": "ANALYTICAL_PROVIDER"
            },
            {
              "const": "ANALYTICAL_PARENT_CHILD_HIERARCHY_NODE"
            },
            {
              "const": "ANALYTICAL_KPI"
            },
            {
              "const": "OUTPUT_FORM_DATA_PROVIDER"
            },
            {
              "const": "OUTPUT_EMAIL_DATA_PROVIDER"
            },
            {
              "const": "OUTPUT_PARAMETER_DETERMINATION_DATA_SOURCE"
            },
            {
              "const": "SITUATION_ANCHOR"
            },
            {
              "const": "SITUATION_TRIGGER"
            },
            {
              "const": "SITUATION_DATACONTEXT"
            },
            {
              "const": "KEY_USER_COPYING_TEMPLATE"
            },
            {
              "const": "EXTERNAL_DATA_PROVIDER"
            },
            {
              "const": "ODM_COMPLIANT_PROVIDER"
            },
            {
              "const": "UI_PROVIDER_PROJECTION_SOURCE"
            }
          ]
        }
      },
      "additionalProperties": false,
      "required": [
        "#"
      ]
    }
  }
}