{
  "definitions": {},
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "http://example.com/root.json",
  "type": "object",
  "title": "The WIS mesh distribution schema",
  "required": [
    "pubTime",
    "baseURL",
    "relPath",
  ],
  "properties": {
    "pubTime": {
      "$id": "#/properties/pubTime",
      "type": "string",
      "title": "Publication time",
      "description": "Time of ingestion into the mesh. ISO 8601.",
      "examples": [
        "20190213T123456.789Z"
      ],
    },
    "baseURL": {
      "$id": "#/properties/baseURL",
      "type": "string",
      "title": "Base url of the service",
      "description": "URL pointing to the server that send this notification and where the data (file) is available",
      "examples": [
        "https://host.example.com/data"
      ],
    },
    "relPath": {
      "$id": "#/properties/relPath",
      "type": "string",
      "title": "Relative path",
      "description": "Relative path indentifies location of the file (relative to the base URL) but also can be considered as very brief metadata as the path is expected to contain standardised components such as name of producing organization.",
      "examples": [
        "20190213/wis/int/wmo/example/test.txt"
      ],
      "pattern": "^(.*)$"
    },
    "sum": {
      "$id": "#/properties/sum",
      "type": "object",
      "title": "Checksum of the file.",
      "required": [
        "method",
        "value"
      ],
      "properties": {
        "method": {
          "$id": "#/properties/sum/properties/method",
          "type": "string",
          "title": "Checksumming method",
          "examples": [
            "SHA256", "MD5"
          ],
        },
        "value": {
          "$id": "#/properties/sum/properties/value",
          "type": "string",
          "title": "The Value Schema",
          "description": "Hexadecimal",
          "examples": [
            "f47710b439bab9bd8e045d104f95e6e3d0fc3ecc5031dbe3ef230feca551060d"
          ],
        }
      }
    },
    "partitionStrategy": {
      "$id": "#/properties/partitionStrategy",
      "type": "object",
      "title": "Partition strategy",
      "description": "Optional way of anouncing patrialy available files."
      "required": [
        "method",
        "blockSize",
        "blockNumber",
        "lastBlock"
      ],
      "properties": {
        "method": {
          "$id": "#/properties/partitionStrategy/properties/method",
          "type": "string",
          "title": "The Method Schema",
          "default": "",
          "examples": [
            "1"
          ],
          "pattern": "^(.*)$"
        },
        "blockSize": {
          "$id": "#/properties/partitionStrategy/properties/blockSize",
          "type": "string",
          "title": "The Blocksize Schema",
          "default": "",
          "examples": [
            "65535"
          ],
          "pattern": "^(.*)$"
        },
        "blockNumber": {
          "$id": "#/properties/partitionStrategy/properties/blockNumber",
          "type": "integer",
          "title": "The Blocknumber Schema",
          "default": 0,
          "examples": [
            0
          ]
        },
        "lastBlock": {
          "$id": "#/properties/partitionStrategy/properties/lastBlock",
          "type": "boolean",
          "title": "The Lastblock Schema",
          "default": false,
          "examples": [
            false
          ]
        }
      }
    },
    "content": {
      "$id": "#/properties/content",
      "type": "string",
      "title": "Content (body) of the file",
      "description": "Optional way how to send the content of a file to optimize transfer of small files. Base 64 encoded.",
      "examples": [
        "dGVzdGluZyBtZXNzYWdlCg=="
      ],
    },
    "signature": {
      "$id": "#/properties/signature",
      "type": "string",
      "title": "Digital signature.",
      "description": "Alternative to the sum. Allows verification of the data porovenance.",
      "examples": [
        "TBD"
      ],
    }
  }
}
