{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://cpd.credit/downloads/cpd-credit-feed-v1.schema.json",
  "title": "CPD.credit Static Publisher Feed v1",
  "type": "object",
  "required": [
    "standard",
    "publisher",
    "items"
  ],
  "properties": {
    "standard": {
      "const": "cpd-credit-feed/1"
    },
    "publisher": {
      "type": "object",
      "required": [
        "name"
      ],
      "properties": {
        "name": {
          "type": "string",
          "minLength": 1,
          "maxLength": 300
        },
        "homepage": {
          "type": [
            "string",
            "null"
          ],
          "pattern": "^https://[^\\s]+$",
          "maxLength": 2000
        },
        "issn": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 20
        },
        "doi_prefix": {
          "type": [
            "string",
            "null"
          ],
          "maxLength": 30
        }
      }
    },
    "items": {
      "type": "array",
      "maxItems": 10000,
      "items": {
        "type": "object",
        "required": [
          "article_id",
          "url",
          "title",
          "updated_at",
          "version",
          "status",
          "access",
          "content_format"
        ],
        "properties": {
          "article_id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._:/-]{1,200}$"
          },
          "doi": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^10\\.\\d{4,9}/\\S{1,300}$"
          },
          "url": {
            "type": "string",
            "pattern": "^https://[^\\s]+$",
            "maxLength": 2000
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "authors": {
            "type": "array",
            "maxItems": 200,
            "items": {
              "oneOf": [
                {
                  "type": "string",
                  "maxLength": 300
                },
                {
                  "type": "object",
                  "required": [
                    "name"
                  ],
                  "properties": {
                    "name": {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 300
                    }
                  }
                }
              ]
            }
          },
          "published_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          },
          "version": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100
          },
          "status": {
            "enum": [
              "published",
              "revised",
              "withdrawn",
              "restricted"
            ]
          },
          "licence": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 300
          },
          "access": {
            "enum": [
              "open",
              "restricted"
            ]
          },
          "content_url": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^https://[^\\s]+$",
            "maxLength": 2000
          },
          "content_format": {
            "enum": [
              "jats",
              "html",
              "json"
            ]
          }
        }
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ],
      "maxLength": 500
    }
  },
  "description": "Static whole-catalogue JSON. next_cursor may be null or omitted. Constructed example downloads are not real publisher records."
}
