{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "allOf": [
    {
      "anyOf": [
        {
          "$ref": "#/definitions/specifiedProvider"
        },
        {
          "$ref": "#/definitions/defaultProvider"
        }
      ]
    },
    {
      "anyOf": [
        {
          "$ref": "#/definitions/specifiedDestination"
        },
        {
          "$ref": "#/definitions/defaultDestination"
        }
      ]
    }
  ],
  "definitions": {
    "libraryEntry": {
      "required": ["library"],
      "properties": {
        "files": {
          "description": "The file names of the individual files to copy to the project.",
          "type": "array",
          "default": null,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "library": {
          "description": "The unique identifier of the library.",
          "type": "string",
          "minLength": 1
        },
        "destination": {
          "description": "The relative folder path from this config file to the location where the files should be copied to.",
          "type": "string",
          "pattern": "^[^\\\\]+$"
        },
        "provider": {
          "description": "The unique identifier of the provider",
          "type": "string",
          "minLength": 1
        }
      }
    },
    "specifiedProvider": {
      "properties": {
        "libraries": {
          "items": {
            "required": ["provider"]
          }
        }
      },
      "not": {
        "required": ["defaultProvider"]
      }
    },
    "defaultProvider": {
      "properties": {
        "defaultProvider": {
          "description": "The unique identifier of the provider to use as default.",
          "type": "string",
          "minLength": 1
        }
      }
    },
    "specifiedDestination": {
      "properties": {
        "libraries": {
          "items": {
            "required": ["destination"]
          }
        }
      },
      "not": {
        "required": ["defaultDestination"]
      }
    },
    "defaultDestination": {
      "properties": {
        "defaultDestination": {
          "description": "The default destination to place library files.",
          "type": "string",
          "minLength": 1
        }
      }
    }
  },
  "id": "https://json.schemastore.org/libman.json",
  "properties": {
    "libraries": {
      "description": "A list of library references.",
      "type": "array",
      "items": {
        "$ref": "#/definitions/libraryEntry"
      }
    },
    "version": {
      "description": "The syntax version of this config file. Can only be 1.0",
      "enum": ["1.0"],
      "default": "1.0"
    }
  },
  "required": ["libraries"],
  "title": "JSON schema for client-side library config files",
  "type": "object"
}
