ssube/cautious-journey

View on GitHub
src/config/schema.yml

Summary

Maintainability
Test Coverage
$schema: "http://json-schema.org/schema#"
$id: cautious-journey
definitions:
  hex-string:
    type: string
    pattern: "^[0-9a-fA-F]{6}$"

  label-ref:
    type: object
    required:
      - name
    properties:
      name:
        type: string

  change-set:
    type: object
    required:
      - adds
      - removes
    properties:
      adds:
        type: array
        items:
          $ref: "#/definitions/label-ref"
        default: []
      removes:
        type: array
        items:
          $ref: "#/definitions/label-ref"
        default: []

  base-label:
    type: object
    required:
      - name
      - requires
    properties:
      color:
        $ref: "#/definitions/hex-string"
      desc:
        type: string
        default: ''
      name:
        type: string
      requires:
        type: array
        items:
          $ref: "#/definitions/label-ref"
        default: []

  flag-label:
    allOf:
      - $ref: "#/definitions/change-set"
      - $ref: "#/definitions/base-label"

  state-change:
    allOf:
      - $ref: "#/definitions/change-set"
      - type: object
        required:
          - matches
        properties:
          matches:
            items:
              $ref: "#/definitions/label-ref"

  state-label:
    allOf:
      - $ref: "#/definitions/change-set"
      - $ref: "#/definitions/base-label"
      - type: object
        required:
          - divider
          - values
        properties:
          divider:
            type: string
            default: "/"
          values:
            type: array
            items:
              $ref: "#/definitions/state-value"
            default: []

  state-value:
    allOf:
      - $ref: "#/definitions/change-set"
      - $ref: "#/definitions/base-label"
      - type: object
        required:
          - becomes
        properties:
          becomes:
            type: array
            items:
              $ref: "#/definitions/state-change"
            default: []

  remote:
    type: object
    required:
      - data
      - type
    properties:
      type:
        type: string
        enum:
          - github-remote
          - gitlab-remote
      data:
        type: object
        additionalProperties: false
        patternProperties:
          ".*":
            type: string

  project:
    type: object
    required:
      - colors
      - comment
      - flags
      - initial
      - name
      - remote
      - states
    properties:
      colors:
        type: array
        items:
          $ref: "#/definitions/hex-string"
        default: []
      comment:
        type: boolean
        default: true
      flags:
        type: array
        items:
          $ref: "#/definitions/flag-label"
        default: []
      initial:
        type: array
        items:
          type: string
        default: []
      name:
        type: string
      remote:
        $ref: "#/definitions/remote"
      states:
        type: array
        items:
          $ref: "#/definitions/state-label"
        default: []

  logger:
    type: object
    required:
      - level
      - name
    properties:
      level:
        type: string
      name:
        type: string

  config:
    type: object
    required:
      - logger
      - projects
    properties:
      logger:
        $ref: "#/definitions/logger"
      projects:
        type: array
        items:
          $ref: "#/definitions/project"
        
type: object