$schema: https://json-schema.org/draft/2019-09/schema
$id: https://schemas.toa.io/0.0.0/context

type: object
properties:
  version:
    $ref: 'definitions#/definitions/version'
  name:
    $ref: 'definitions#/definitions/label'
  description:
    type: string
  packages:
    type: string
  build:
    type: object
    properties:
      command:
        type: string
  runtime:
    type: object
    properties:
      version:
        $ref: 'definitions#/definitions/version'
      registry:
        type: string
        format: uri
      proxy:
        type: string
        format: uri
    required: [version]
  environment:
    type: string
  registry:
    type: object
    properties:
      base:
        type: string
      platforms:
        type: array
        nullable: true
        minItems: 1
        items:
          type: string
        default:
          - linux/amd64
          - linux/arm/v7
          - linux/arm64
    required: [base, platforms]
  compositions:
    type: array
    minItems: 1
    items:
      type: object
      properties:
        name:
          $ref: 'definitions#/definitions/token'
        components:
          type: array
          minItems: 1
          items:
            $ref: 'definitions#/definitions/locator'
      required: [name, components]
  annotations:
    type: object
required: [runtime, name, packages, registry]
additionalProperties: false
