{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openassignment.io/schemas/v0.1/manifest.schema.json",
  "title": "OpenAssignment entry file",
  "description": "The entry file a company serves at /openassignment.json on its own domain. It identifies the publisher and lists the published assignments. Draft specification 0.1.",
  "type": "object",
  "required": [
    "standard",
    "schemaVersion",
    "publisher",
    "updatedAt",
    "assignments"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "format": "uri",
      "description": "URL of the schema this document follows."
    },
    "standard": {
      "const": "OpenAssignment",
      "description": "Name of the standard."
    },
    "schemaVersion": {
      "type": "string",
      "pattern": "^0\\.1\\.(0|[1-9][0-9]*)$",
      "description": "Version of OpenAssignment the entry file follows, for example \"0.1.0\"."
    },
    "publisher": {
      "type": "object",
      "description": "The organisation that publishes the assignments on this domain.",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "description": "Name of the organisation."
        },
        "url": {
          "type": "string",
          "format": "uri",
          "description": "The organisation's website."
        }
      }
    },
    "updatedAt": {
      "type": "string",
      "format": "date-time",
      "description": "When the entry file or any listed assignment last changed."
    },
    "assignments": {
      "type": "array",
      "description": "One entry per published assignment. An empty list is valid.",
      "items": {
        "type": "object",
        "required": [
          "id",
          "url",
          "status",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1,
            "description": "The assignment's stable identifier, identical to `id` in the assignment."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "The assignment's source address, identical to `canonicalUrl` in the assignment."
          },
          "status": {
            "enum": [
              "open",
              "paused",
              "filled",
              "closed"
            ],
            "description": "Current status, identical to `status` in the assignment. Lets clients notice a closed assignment without fetching it."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the assignment last changed. Lets clients skip assignments they already have."
          },
          "htmlUrl": {
            "type": "string",
            "format": "uri",
            "description": "URL of the human readable page."
          }
        }
      }
    }
  }
}
