{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "BCL Component",
  "description": "BCL search results schema for components",
  "type": "object",
  "properties": {
    "name": {
      "description": "Machine name of the component (use underscores instead of spaces)",
      "type": "string"
    },
    "display_name": {
      "description": "Display name of the component",
      "type": "string"
    },
    "uuid": {
      "description": "Universally Unique ID of the component",
      "type": "string"
    },
    "vuuid": {
      "description": "Universally Unique Version ID of the component. Legacy field. Same as version_id",
      "type": "string"
    },
    "version_id": {
      "description": "Universally Unique Version ID of the component",
      "type": "string"
    },
    "description": {
      "description": "Description of the component",
      "type": "string"
    },
    "modeler_description": {
      "description": "Description of the component intended for modelers. Contains more usage and implementation details.",
      "type": "string"
    },
    "attributes": {
      "description": "Array of attributes that describe the component. The list of valid attributes can be found at https://bcl.nlr.gov/tags#attributes",
      "type": "array",
      "items": {
        "$ref": "#/definitions/attribute"
      }
    },
    "openstudio_version": {
      "description": "Version of OpenStudio that the original component was made for",
      "type": "string"
    },
    "openstudio_min_compatible": {
      "description": "Minimum compatible OpenStudio version",
      "type": "string"
    },
    "openstudio_max_compatible": {
      "description": "Maximum compatible OpenStudio version",
      "type": "string"
    },
    "files": {
      "description": "Array of files found in component directory",
      "type": "array",
      "items": {
        "$ref": "#/definitions/file"
      }
    },
    "org": {
      "description": "Organization name of the origin GitHub repository",
      "type": "string"
    },
    "repo": {
      "description": "Name of the origin GitHub repository",
      "type": "string"
    },
    "repo_url": {
      "description": "URL of the origin GitHub repository",
      "type": "string"
    },
    "release_tag": {
      "description": "Tag version number of the GitHub repository release containing this component",
      "type": "string"
    },
    "bundle": {
      "description": "Bundle type of this content. This is always set to 'component' for components",
      "type": "string",
      "enum": [
        "component"
      ]
    },
    "download_url": {
      "description": "BCL URL that can be used to download the component",
      "type": "string"
    },
    "tags": {
      "description": "Taxonomy tag used to classify the component. Array should contain a single element that contains the full classification hierarchy separated by dots (.); for example, for a window component the tag should be: 'Construction Assembly.Fenestration.Window'. Visit https://bcl.nlr.gov/tags#component for the full tag taxonomy.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/tag"
      }
    }
  },
  "definitions": {
    "attribute": {
      "description": "Attribute used to identify a component",
      "type": "object",
      "properties": {
        "name": {
          "description": "The attribute's name",
          "type": "string"
        },
        "value": {
          "description": "The attribute's value",
          "type": [
            "string",
            "number"
          ]
        },
        "datatype": {
          "description": "The data type that the attribute value is represented in",
          "type": "string",
          "enum": [
            "Boolean",
            "Floating-point number",
            "Integer",
            "String"
          ]
        },
        "units": {
          "description": "The units that the attribute value is represented in",
          "type": "string"
        }
      }
    },
    "file": {
      "description": "File found in the component directory",
      "type": "object",
      "properties": {
        "filename": {
          "description": "Name of the file",
          "type": "string"
        },
        "filetype": {
          "description": "Type of file (file extension)",
          "type": "string"
        },
        "url": {
          "description": "BCL URL that can be used to download a particular file directly.",
          "type": "string"
        },
        "version": {
          "description": "Information on the software version compatible with the file",
          "type": "object",
          "properties": {
            "software_program": {
              "description": "Name of the software program that uses this file; for example, OpenStudio or EnergyPlus",
              "type": "string"
            },
            "identifier": {
              "description": "The version identifier of the software used to create the original version of the file",
              "type": "string"
            },
            "min_compatible": {
              "description": "Minimum software version that this file is compatible with",
              "type": "string"
            },
            "max_compatible": {
              "description": "Maximum software version that this file is compatible with",
              "type": "string"
            }
          }
        }
      }
    },
    "tag": {
      "description": "Full hierarchy of the Tag used to classify the component. Visit https://bcl.nlr.gov/tags#component for the full tag taxonomy.",
      "type": "string"
    }
  }
}
