{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "ComponentV1alpha1",
  "description": "A Component describes a software component. It is typically intimately linked to the source code that constitutes the component, and should be what a developer may regard a \"unit of software\", usually with a distinct deployable or linkable artifact.",
  "examples": [
    {
      "apiVersion": "backstage.io/v1alpha1",
      "kind": "Component",
      "metadata": {
        "name": "LoremService",
        "description": "Creates Lorems like a pro.",
        "labels": {
          "product_name": "Random value Generator"
        },
        "annotations": {
          "docs": "https://github.com/..../tree/develop/doc"
        }
      },
      "spec": {
        "type": "service",
        "lifecycle": "production",
        "owner": "tools"
      }
    }
  ],
  "allOf": [
    {
      "$ref": "Entity"
    },
    {
      "type": "object",
      "required": ["spec"],
      "properties": {
        "apiVersion": {
          "enum": ["backstage.io/v1alpha1", "backstage.io/v1beta1"]
        },
        "kind": {
          "enum": ["Component"]
        },
        "spec": {
          "type": "object",
          "required": ["type", "lifecycle", "owner"],
          "properties": {
            "type": {
              "type": "string",
              "description": "The type of component.",
              "examples": ["service", "website", "library"],
              "minLength": 1
            },
            "lifecycle": {
              "type": "string",
              "description": "The lifecycle state of the component.",
              "examples": ["experimental", "production", "deprecated"],
              "minLength": 1
            },
            "owner": {
              "type": "string",
              "description": "An entity reference to the owner of the component.",
              "examples": ["artist-relations-team", "user:john.johnson"],
              "minLength": 1
            },
            "system": {
              "type": "string",
              "description": "An entity reference to the system that the component belongs to.",
              "minLength": 1
            },
            "subcomponentOf": {
              "type": "string",
              "description": "An entity reference to another component of which the component is a part.",
              "minLength": 1
            },
            "providesApis": {
              "type": "array",
              "description": "An array of entity references to the APIs that are provided by the component.",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "consumesApis": {
              "type": "array",
              "description": "An array of entity references to the APIs that are consumed by the component.",
              "items": {
                "type": "string",
                "minLength": 1
              }
            },
            "dependsOn": {
              "type": "array",
              "description": "An array of references to other entities that the component depends on to function.",
              "items": {
                "type": "string",
                "minLength": 1
              }
            }
          }
        }
      }
    }
  ]
}
