{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://catalog.lintel.tools/schemas/schemastore/lego-json/versions/1.0.json",
  "x-lintel": {
    "source": "https://www.schemastore.org/lego.json",
    "sourceSha256": "386b2332759a272b49bad12b6ee8383b343f63ce56b1891766acb0be523d2567",
    "fileMatch": [
      "lego.json"
    ],
    "parsers": [
      "json"
    ]
  },
  "type": "object",
  "properties": {
    "blocks": {
      "description": "An array of your app's blocks.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "type": {
            "description": "The name of the block type",
            "type": "string"
          },
          "path": {
            "description": "Path relative to root where the block will be stored",
            "type": "string"
          },
          "isFile": {
            "description": "Is this a file? or a folder? False by default.",
            "type": "boolean"
          },
          "files": {
            "description": "Files making up the block",
            "type": "array",
            "items": {
              "$ref": "#/$defs/file"
            }
          },
          "file": {
            "$ref": "#/$defs/file"
          }
        },
        "required": [
          "type",
          "path"
        ]
      }
    },
    "fileFormats": {
      "description": "An object mapping file objects to strings",
      "type": "object",
      "patternProperties": {
        ".*": {
          "$ref": "#/$defs/fileFormat"
        }
      }
    }
  },
  "required": [
    "blocks"
  ],
  "$defs": {
    "file": {
      "oneOf": [
        {
          "description": "This object or string represents the file format",
          "type": "string"
        },
        {
          "description": "This object or string represents the file format",
          "type": "null"
        },
        {
          "$ref": "#/$defs/fileFormat",
          "description": "This object or string represents the file format"
        }
      ]
    },
    "fileFormat": {
      "description": "This object represents a file format",
      "type": "object",
      "properties": {
        "name": {
          "description": "Name of block file",
          "type": "string"
        },
        "template": {
          "description": "Path to file template",
          "type": "string"
        }
      },
      "required": [
        "name"
      ]
    }
  },
  "id": "https://json.schemastore.org/lego.json"
}
