---

#
# JSON Schema definition for `fmf` discover plugin
#
# https://tmt.readthedocs.io/en/stable/spec/plans.html#fmf
#

$id: /schemas/discover/fmf
$schema: https://json-schema.org/draft-07/schema

type: object
additionalProperties: false

properties:

  how:
    type: string
    enum:
      - fmf

  name:
    type: string

  summary:
    $ref: "/schemas/core#/definitions/summary"

  url:
    $ref: "/schemas/common#/definitions/fmf_id/properties/url"

  url-content-type:
    type: string
    enum:
      - git
      - archive

  ref:
    $ref: "/schemas/common#/definitions/fmf_id/properties/ref"

  path:
    $ref: "/schemas/common#/definitions/fmf_id/properties/path"

  order:
    $ref: "/schemas/core#/definitions/order"

  test:
    oneOf:
      - type: string
      - type: array
        items:
          anyOf:
            - type: string
            - type: object
              additionalProperties: true
              properties:
                name:
                  type: string
              required:
                - name

  require-test:
    $ref: "/schemas/common#/definitions/one_or_more_strings"

  link:
    $ref: "/schemas/common#/definitions/one_or_more_strings"

  filter:
    $ref: "/schemas/common#/definitions/one_or_more_strings"

  include:
    $ref: "/schemas/common#/definitions/one_or_more_strings"

  exclude:
    $ref: "/schemas/common#/definitions/one_or_more_strings"

  prune:
    type: boolean

  dist-git-extract:
    type: string

  dist-git-init:
    type: boolean

  dist-git-merge:
    type: boolean

  dist-git-remove-fmf-root:
    type: boolean

  dist-git-source:
    $ref: "/schemas/common#/definitions/dist-git-source"

  dist-git-type:
    $ref: "/schemas/common#/definitions/dist-git-type"

  dist-git-download-only:
    $ref: "/schemas/common#/definitions/dist-git-download-only"

  dist-git-install-builddeps:
    $ref: "/schemas/common#/definitions/dist-git-install-builddeps"

  dist-git-require:
    $ref: "/schemas/common#/definitions/dist-git-require"

  fmf-id:
    type: boolean

  modified-only:
    type: boolean

  modified-url:
    type: string
    format: uri

  modified-ref:
    type: string

  sync-repo:
    type: boolean

  where:
    $ref: "/schemas/common#/definitions/where"

  when:
    $ref: "/schemas/common#/definitions/when"

  adjust-tests:
    $ref: "/schemas/core#/definitions/adjust"

  repository:
    type: string

  revision:
    type: string

required:
  - how
