Path: blob/master/docs/service_specification.schema.json
12518 views
{1"$schema": "http://json-schema.org/draft-07/schema",2"$id": "backstage.io/v1alpha1",3"type": "object",4"title": "A JSON Schema for Backstage catalog entities.",5"description": "Each descriptor file has a number of entities. This schema matches each of those.",6"examples": [7{8"apiVersion": "backstage.io/v1alpha1",9"kind": "Component",10"metadata": {11"name": "LoremService",12"description": "Creates Lorems like a pro.",13"labels": {14"product_name": "Random value Generator"15},16"annnotations": {17"docs": "https://github.com/..../tree/develop/doc"18},19"teams": [20{21"name": "Team super great",22"email": "[email protected]"23}24]25},26"spec": {27"type": "service",28"lifecycle": "production",29"owner": "[email protected]"30}31}32],33"required": ["apiVersion", "kind", "metadata"],34"additionalProperties": false,35"properties": {36"apiVersion": {37"type": "string",38"description": "Version of the specification format for a particular file is written against.",39"enum": ["backstage.io/v1alpha1", "backstage.io/v1beta1"]40},41"kind": {42"type": "string",43"description": "High level entity type being described, from the Backstage system model.",44"enum": ["Component"]45},46"metadata": {47"$ref": "#/definitions/metadata"48},49"spec": {50"$ref": "#/definitions/spec"51}52},53"definitions": {54"metadata": {55"type": "object",56"description": "Metadata about the entity, i.e. things that aren't directly part of the entity specification itself.",57"required": ["name"],58"additionalProperties": true,59"properties": {60"name": {61"type": "string",62"pattern": "^[a-z0-9A-Z_.-]{1,63}$",63"description": "The name of the entity. This name is both meant for human eyes to recognize the entity, and for machines and other components to reference the entity"64},65"description": {66"type": "string",67"description": "A human readable description of the entity, to be shown in Backstage. Should be kept short and informative."68},69"namespace": {70"type": "string",71"description": "The name of a namespace that the entity belongs to."72},73"labels": {74"type": "object",75"description": "Labels are optional key/value pairs of that are attached to the entity, and their use is identical to kubernetes object labels.",76"additionalProperties": true,77"patternProperties": {78"^([a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\\.[a-zA-Z]{2,}/)?[a-z0-9A-Z_\\-\\.]{1,63}$": {79"type": "string",80"pattern": "^[a-z0-9A-Z_.-]{1,63}$"81}82}83},84"annnotations": {85"type": "object",86"description": "Arbitrary non-identifying metadata attached to the entity, identical in use to kubernetes object annotations.",87"additionalProperties": true,88"patternProperties": {89"^([a-zA-Z0-9][a-zA-Z0-9-]{1,61}[a-zA-Z0-9]\\.[a-zA-Z]{2,}/)?[a-z0-9A-Z_\\-\\.]{1,63}$": {90"type": "string",91"pattern": "^[a-z0-9A-Z_.-]{1,63}$"92}93}94}95}96},97"spec": {98"type": "object",99"description": "Actual specification data that describes the entity. TODO: shape depend on `kind`",100"required": ["type", "lifecycle", "owner"],101"additionalProperties": true,102"properties": {103"type": {104"type": "string",105"description": "The type of component.",106"examples": ["service"]107},108"lifecycle": {109"type": "string",110"description": "The lifecycle step that this component is in.",111"examples": ["production"]112},113"owner": {114"type": "string",115"description": "The owner of the component.",116"examples": ["[email protected]"]117}118}119}120}121}122123124