{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$id": "https://schema.humancellatlas.org/bundle/9.0.0/protocol",
  "description": "A schema for a protocol bundle.",
  "additionalProperties": false,
  "required": [
    "describedBy",
    "schema_type"
  ],
  "title": "protocol",
  "type": "object",
  "definitions": {
    "protocol_ingest": {
      "required": [
        "hca_ingest",
        "content"
      ],
      "type": "object",
      "properties": {
        "hca_ingest": {
          "description": "Core fields added by HCA ingest service",
          "type": "object",
          "$ref": "https://schema.humancellatlas.org/bundle/5.2.1/ingest_audit"
        },
        "content": {
          "description": "Content for any process type entity.",
          "type": "object",
          "oneOf": [
            {
              "$ref": "https://schema.humancellatlas.org/type/protocol/analysis/6.1.1/analysis_protocol"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/protocol/biomaterial_collection/2.0.0/enrichment_protocol"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/protocol/biomaterial_collection/8.0.0/collection_protocol"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/protocol/biomaterial_collection/3.0.0/dissociation_protocol"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/protocol/imaging/6.1.1/imaging_protocol"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/protocol/sequencing/4.0.0/library_preparation_protocol"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/protocol/sequencing/7.0.0/sequencing_protocol"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/protocol/6.1.1/protocol"
            }
          ]
        }
      }
    }
  },
  "properties": {
    "describedBy": {
      "description": "The URL reference to the schema.",
      "type": "string",
      "pattern": "^(http|https)://schema.(.*?)humancellatlas.org/(([0-9]{1,}.[0-9]{1,}.[0-9]{1,})|([a-zA-Z]*?))/protocol"
    },
    "schema_version": {
      "description": "The version number of the schema in major.minor.patch format.",
      "type": "string",
      "pattern": "^[0-9]{1,}.[0-9]{1,}.[0-9]{1,}$"
    },
    "schema_type": {
      "description": "The type of the metadata schema entity.",
      "type": "string",
      "enum": [
        "protocol_bundle"
      ]
    },
    "protocols": {
      "description": "An array of protocols.",
      "items": {
        "$ref": "https://schema.humancellatlas.org/bundle/9.0.0/protocol#/definitions/protocol_ingest"
      },
      "type": "array"
    }
  }
}
