{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "$id": "https://schema.humancellatlas.org/bundle/7.1.0/biomaterial",
  "description": "A schema for a biomaterial bundle.",
  "additionalProperties": false,
  "required": [
    "describedBy",
    "schema_type"
  ],
  "title": "biomaterial",
  "type": "object",
  "definitions": {
    "biomaterial_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 biomaterial type entity.",
          "type": "object",
          "oneOf": [
            {
              "$ref": "https://schema.humancellatlas.org/type/biomaterial/5.2.1/donor_organism"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/biomaterial/5.2.3/specimen_from_organism"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/biomaterial/7.0.0/cell_suspension"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/biomaterial/6.0.0/organoid"
            },
            {
              "$ref": "https://schema.humancellatlas.org/type/biomaterial/7.1.0/cell_line"
            }
          ]
        }
      }
    }
  },
  "properties": {
    "describedBy": {
      "description": "The URL reference to the schema.",
      "type": "string",
      "pattern": "^(http|https)://schema.(.*?)humancellatlas.org/bundle/(([0-9]{1,}.[0-9]{1,}.[0-9]{1,})|([a-zA-Z]*?))/biomaterial"
    },
    "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": [
        "biomaterial_bundle"
      ]
    },
    "biomaterials": {
      "description": "An array of biomaterials.",
      "type": "array",
      "items": {
        "$ref": "https://schema.humancellatlas.org/bundle/7.1.0/biomaterial#/definitions/biomaterial_ingest"
      }
    }
  }
}
