{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "CLARA portable project",
  "type": "object",
  "required": [
    "format",
    "name",
    "source",
    "tests",
    "program",
    "sha256"
  ],
  "properties": {
    "format": {
      "const": "CLARA-PROJECT-1"
    },
    "name": {
      "type": "string",
      "minLength": 1,
      "maxLength": 120
    },
    "source": {
      "type": "string",
      "maxLength": 100000
    },
    "tests": {
      "type": "array",
      "maxItems": 16,
      "items": {
        "type": "object",
        "required": [
          "name",
          "method",
          "path",
          "status"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "method": {
            "enum": [
              "GET",
              "POST",
              "PUT",
              "PATCH",
              "DELETE"
            ]
          },
          "path": {
            "type": "string",
            "pattern": "^/api/"
          },
          "status": {
            "type": "integer",
            "minimum": 200,
            "maximum": 599
          },
          "contains": {
            "type": "string"
          },
          "body": {
            "type": "object"
          }
        }
      }
    },
    "program": {
      "type": "object"
    },
    "sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    }
  }
}
