{
  "$defs": {
    "dataset": {
      "$id": "/dataset",
      "$schema": "http://json-schema.org/draft-07/schema#",
      "description": "List of the datasets used in the transformation scheme",
      "items": {
        "properties": {
          "DataStructure": {
            "description": "The structure definition of the dataset as a list of components",
            "items": {
              "if": {
                "properties": {
                  "role": {
                    "const": "identifier"
                  }
                },
                "required": [
                  "nullable"
                ]
              },
              "properties": {
                "name": {
                  "description": "The name of the component",
                  "type": "string"
                },
                "nullable": {
                  "description": "Whether the subset includes the null value or not",
                  "type": "boolean"
                },
                "role": {
                  "description": "The role of the component",
                  "enum": [
                    "identifier",
                    "measure",
                    "attribute",
                    "viral attribute"
                  ]
                },
                "type": {
                  "description": "The value domain subset of the component",
                  "type": "string"
                }
              },
              "required": [
                "name",
                "role",
                "type",
                "nullable"
              ],
              "then": {
                "properties": {
                  "nullable": {
                    "const": false
                  }
                }
              },
              "type": "object"
            },
            "type": "array"
          },
          "name": {
            "description": "The name of the dataset",
            "type": "string"
          }
        },
        "required": [
          "name",
          "DataStructure"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "$id": "https://sdmx.org/resources/VTL/schemas/v2_0/metadata",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "description": "The description of metadata consumed by the VTL transformation scheme",
  "properties": {
    "domains": {
      "description": "List of the value domain subsets consumed by the VTL transformation scheme",
      "items": {
        "properties": {
          "name": {
            "description": "The name of the value domain subset",
            "type": "string"
          },
          "setlist": {
            "description": "If this domain subset is a codelist, the set of codes",
            "items": {
              "type": "string"
            },
            "type": "array",
            "uniqueItems": true
          },
          "type": {
            "description": "The parent value domain subset name",
            "type": "string"
          }
        },
        "required": [
          "name",
          "type",
          "setlist"
        ],
        "type": "object"
      },
      "type": "array"
    },
    "input_datasets": {
      "$ref": "#/dataset"
    },
    "output_datasets": {
      "$ref": "#/dataset"
    }
  },
  "required": [
    "input_datasets",
    "domains"
  ],
  "title": "VTL metadata repository",
  "type": "object"
}