{
  "title": "CodeExpression",
  "@id": "stencila:CodeExpression",
  "extends": "CodeFragment",
  "role": "secondary",
  "status": "stable",
  "category": "code",
  "description": "An expression defined in programming language source code.",
  "properties": {
    "type": {
      "@id": "schema:type",
      "description": "The name of the type.",
      "type": "string",
      "enum": [
        "CodeExpression"
      ],
      "default": "CodeExpression",
      "from": "Entity"
    },
    "id": {
      "@id": "schema:id",
      "description": "The identifier for this item.",
      "type": "string",
      "from": "Entity"
    },
    "meta": {
      "@id": "stencila:meta",
      "description": "Metadata associated with this item.",
      "type": "object",
      "from": "Entity"
    },
    "programmingLanguage": {
      "@id": "schema:programmingLanguage",
      "description": "The programming language of the code.",
      "type": "string",
      "from": "Code"
    },
    "format": {
      "@id": "schema:encodingFormat",
      "aliases": [
        "encoding",
        "encodingFormat"
      ],
      "description": "Media type, typically expressed using a MIME format, of the code.",
      "$comment": "This property allows the differentiation of formats using the same programming language\nor variants of a programming language. An example is using `programmingLanguage` \"json\" and\n`encodingFormat` \"application/ld+json\" for JSON-LD code examples.\n",
      "type": "string",
      "from": "Code"
    },
    "text": {
      "@id": "schema:text",
      "description": "The text of the code.",
      "type": "string",
      "from": "Code"
    },
    "output": {
      "@id": "stencila:output",
      "description": "The value of the expression when it was last evaluated.",
      "allOf": [
        {
          "$ref": "Node.schema.json"
        }
      ],
      "from": "CodeExpression"
    },
    "errors": {
      "@id": "stencila:errors",
      "description": "Errors when compiling or executing the chunk.",
      "type": "array",
      "items": {
        "$ref": "CodeError.schema.json"
      },
      "from": "CodeExpression",
      "aliases": [
        "error"
      ]
    }
  },
  "file": "CodeExpression.schema.yaml",
  "children": [],
  "descendants": [],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schema.stenci.la/v0/CodeExpression.schema.json",
  "source": "https://github.com/stencila/schema/blob/master/CodeExpression.schema.yaml",
  "type": "object",
  "propertyAliases": {
    "encoding": "format",
    "encodingFormat": "format",
    "error": "errors"
  },
  "additionalProperties": false,
  "required": [
    "type",
    "text"
  ]
}
