{
  "title": "Function",
  "@id": "stencila:Function",
  "extends": "Entity",
  "role": "secondary",
  "status": "unstable",
  "category": "code",
  "description": "A function with a name, which might take Parameters and return a value of a certain type.",
  "properties": {
    "type": {
      "@id": "schema:type",
      "description": "The name of the type.",
      "type": "string",
      "enum": [
        "Function"
      ],
      "default": "Function",
      "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"
    },
    "name": {
      "@id": "schema:name",
      "description": "The name of the function.",
      "type": "string",
      "pattern": "[a-z_][A-z0-9_]*",
      "$comment": "The name property is not required; this allows for anonymous functions\n(although these are not yet implemented in Stencila interpreters).\nThe regex allows for snake_case and camelCase names but excludes\nPascalCase for parameter names.\n",
      "from": "Function"
    },
    "parameters": {
      "@id": "schema:parameters",
      "description": "An array of parameters the function exists.",
      "type": "array",
      "items": [
        {
          "$ref": "Parameter.schema.json"
        }
      ],
      "from": "Function",
      "aliases": [
        "parameter"
      ]
    },
    "returns": {
      "@id": "stencila:returns",
      "description": "The return type of the function.",
      "anyOf": [
        {
          "$ref": "ValidatorTypes.schema.json"
        }
      ],
      "from": "Function"
    }
  },
  "file": "Function.schema.yaml",
  "children": [],
  "descendants": [],
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schema.stenci.la/v0/Function.schema.json",
  "source": "https://github.com/stencila/schema/blob/master/Function.schema.yaml",
  "type": "object",
  "propertyAliases": {
    "parameter": "parameters"
  },
  "additionalProperties": false,
  "required": [
    "type"
  ]
}
