summaryrefslogtreecommitdiff
path: root/schemas/system.json-schema
blob: a2fc0c5d5cd7fd9583cb9416f819d7c17c867af2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
$schema: http://json-schema.org/draft-04/schema#
id: http://git.baserock.org/cgi-bin/cgit.cgi/baserock/baserock/definitions.git/tree/schemas/system.json-schema

description: |
  This is a JSON-Schema description of a 'system' .morph file, which is part of
  the Baserock definitions YAML representation format.

  This JSON-Schema file is valid for VERSION 7 of the Baserock definitions
  YAML serialisation format.

  The Baserock definitions format is the recommended way of representing
  Baserock definitions on disk. The actual data model is described separately.
  See https://wiki.baserock.org/definitions for more information.

  This schema is represented as YAML, so that it can be edited more easily.
  You may need to convert to JSON if using a JSON-Schema tool that expects
  its input to be an actual string containing data serialised as JSON.

definitions:
  # In the Baserock data model, this becomes a list of links to StratumArtifact
  # entities.
  stratum-reference:
    type: object

    required: [ 'morph' ]
    additionalProperties: false

    properties:
      name: { type: string }
      morph: { type: string }
      artifacts:
        type: array
        items: { type: string }


# Corresponds to System in Baserock data model.
system:
type: object

required: [ 'name', 'kind', 'strata' ]
additionalProperties: false

properties:
  name: { type: string }
  kind: { enum: [ "system" ] }
  description: { type: string }

  # Morph and YBD will only accept certain values for 'arch' based on
  # hardcoded conditions in those tools.
  arch: { type: string }

  strata:
    type: array
    items:
      $ref: "#/definitions/stratum-reference"

  configuration-extensions:
    type: array
    items: { type: string }