{
  "$schema": "http://json-schema.org/draft-07/schema",
  "$id": "GroupV1alpha1",
  "description": "A group describes an organizational entity, such as for example a team, a business unit, or a loose collection of people in an interest group. Members of these groups are modeled in the catalog as kind User.",
  "examples": [
    {
      "apiVersion": "backstage.io/v1alpha1",
      "kind": "Group",
      "metadata": {
        "name": "infrastructure",
        "description": "The infra business unit"
      },
      "spec": {
        "type": "business-unit",
        "profile": {
          "displayName": "Infrastructure",
          "email": "infrastructure@example.com",
          "picture": "https://example.com/groups/bu-infrastructure.jpeg"
        },
        "parent": "ops",
        "children": ["backstage", "other"]
      }
    }
  ],
  "allOf": [
    {
      "$ref": "Entity"
    },
    {
      "type": "object",
      "required": ["spec"],
      "properties": {
        "apiVersion": {
          "enum": ["backstage.io/v1alpha1", "backstage.io/v1beta1"]
        },
        "kind": {
          "enum": ["Group"]
        },
        "spec": {
          "type": "object",
          "required": ["type", "children"],
          "properties": {
            "type": {
              "type": "string",
              "description": "The type of group. There is currently no enforced set of values for this field, so it is left up to the adopting organization to choose a nomenclature that matches their org hierarchy.",
              "examples": ["team", "business-unit", "product-area", "root"],
              "minLength": 1
            },
            "profile": {
              "type": "object",
              "description": "Optional profile information about the group, mainly for display purposes. All fields of this structure are also optional. The email would be a group email of some form, that the group may wish to be used for contacting them. The picture is expected to be a URL pointing to an image that's representative of the group, and that a browser could fetch and render on a group page or similar.",
              "properties": {
                "displayName": {
                  "type": "string",
                  "description": "A simple display name to present to users.",
                  "examples": ["Infrastructure"],
                  "minLength": 1
                },
                "email": {
                  "type": "string",
                  "description": "An email where this entity can be reached.",
                  "examples": ["infrastructure@example.com"],
                  "minLength": 1
                },
                "picture": {
                  "type": "string",
                  "description": "The URL of an image that represents this entity.",
                  "examples": [
                    "https://example.com/groups/bu-infrastructure.jpeg"
                  ],
                  "minLength": 1
                }
              }
            },
            "parent": {
              "type": "string",
              "description": "The immediate parent group in the hierarchy, if any. Not all groups must have a parent; the catalog supports multi-root hierarchies. Groups may however not have more than one parent. This field is an entity reference.",
              "examples": ["ops"],
              "minLength": 1
            },
            "children": {
              "type": "array",
              "description": "The immediate child groups of this group in the hierarchy (whose parent field points to this group). The list must be present, but may be empty if there are no child groups. The items are not guaranteed to be ordered in any particular way. The entries of this array are entity references.",
              "items": {
                "type": "string",
                "examples": ["backstage", "other"],
                "minLength": 1
              }
            },
            "members": {
              "type": "array",
              "description": "The users that are members of this group. The entries of this array are entity references.",
              "items": {
                "type": "string",
                "examples": ["jdoe"],
                "minLength": 1
              }
            }
          }
        }
      }
    }
  ]
}
