{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://crypticpy.github.io/phct/examples/resource-library/submit/answers.schema.json",
  "title": "Resource Library: answers for a new resource",
  "description": "The answers to the submission form at https://crypticpy.github.io/phct/examples/resource-library/submit/, one property per question, keyed by the question's key. Leave out any question you do not have an answer for. Files are not part of this JSON: the submitter attaches them on the submit page (or drags them into the GitHub issue).",
  "type": "object",
  "properties": {
    "title": {
      "title": "Title",
      "description": "What is it called? Short, descriptive name.",
      "type": "string",
      "minLength": 1
    },
    "summary": {
      "title": "One-sentence summary",
      "description": "In one or two sentences, what does it give you? One or two sentences shown on the catalog card. Plain language, no jargon.",
      "type": "string",
      "minLength": 1
    },
    "resource_type": {
      "title": "Resource type",
      "description": "What kind of resource is it? Pick the closest match.",
      "type": "string",
      "enum": [
        "Guide",
        "Toolkit",
        "Template",
        "Dataset",
        "Training",
        "Report",
        "Tool"
      ]
    },
    "publisher": {
      "title": "Publisher",
      "description": "Who published it? The organization that produced or hosts the resource.",
      "type": "string"
    },
    "year": {
      "title": "Year published",
      "description": "When was it published or last updated? Publication or last-updated year, if known.",
      "type": "number"
    },
    "contact_email": {
      "title": "Contact email",
      "description": "Who can answer questions about this entry?",
      "type": "string",
      "format": "email"
    },
    "topics": {
      "title": "Topics",
      "description": "What subjects does it cover? Subject areas this resource covers. Each item is one line of its own. Never put a comma inside an item.",
      "type": "array",
      "items": {
        "type": "string",
        "minLength": 1,
        "pattern": "^[^,\\r\\n]+$"
      },
      "minItems": 1
    },
    "audience": {
      "title": "Audience",
      "description": "Who is it most useful for? Select all that apply.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Leadership",
          "Program staff",
          "Analysts",
          "Communications",
          "IT & data teams",
          "External partners"
        ]
      },
      "uniqueItems": true
    },
    "language": {
      "title": "Language",
      "description": "What languages is it available in?",
      "type": "string",
      "enum": [
        "English",
        "Spanish",
        "Multiple languages"
      ]
    },
    "format": {
      "title": "Format",
      "description": "How is it delivered?",
      "type": "string",
      "enum": [
        "Web page",
        "PDF",
        "Video",
        "Spreadsheet",
        "Slide deck",
        "Code"
      ]
    },
    "access": {
      "title": "Access",
      "description": "What does it take to get to it? Select all that apply.",
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "Freely available",
          "Free account required",
          "Paid or licensed",
          "Members only",
          "Request required"
        ]
      },
      "uniqueItems": true,
      "minItems": 1
    },
    "resource_url": {
      "title": "Link to resource",
      "description": "Where does it live? The canonical, publicly accessible link.",
      "type": "string",
      "format": "uri",
      "pattern": "^https?://\\S+$",
      "minLength": 1
    },
    "related_links": {
      "title": "Related links",
      "description": "Anything that goes with it? Companion material, one per line as “Label | URL”. Each link is a short label and a web address.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Short text saying where the link goes."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://\\S+$"
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      }
    },
    "screenshots": {
      "title": "Preview images",
      "description": "Can you show what it looks like? A cover page or sample screen helps people recognise it. No personal information. Only images already hosted at a public https address; each needs alt text of at most 125 characters saying what the screenshot shows. Files are not part of this JSON: the submitter attaches them on the submit page (or drags them into the GitHub issue).",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri",
            "pattern": "^https?://\\S+$"
          },
          "alt": {
            "type": "string",
            "maxLength": 125
          }
        },
        "required": [
          "url"
        ],
        "additionalProperties": false
      }
    },
    "body": {
      "title": "Notes",
      "description": "Tell the full story. Markdown is supported. Why this is worth someone’s time.",
      "type": "string"
    }
  },
  "required": [
    "title",
    "summary",
    "resource_type",
    "topics",
    "access",
    "resource_url"
  ],
  "additionalProperties": false
}
