{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/plinth-us-grants-data/json-schema/plinth-us-grants-data-challenge-issued-schema.json",
  "title": "ChallengeIssued",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/plinth-us-grants-data-platform-api-openapi.yml#/components/schemas/ChallengeIssued",
  "type": "object",
  "properties": {
    "code": {
      "type": "integer"
    },
    "message": {
      "type": "string"
    },
    "questions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ChallengeQuestion"
      }
    },
    "answer_at": {
      "type": "string"
    },
    "attempts": {
      "type": "string",
      "description": "How many answers this challenge takes and how they are spaced. Running out draws a FRESH challenge rather than locking the key."
    }
  },
  "required": [
    "code",
    "questions",
    "answer_at"
  ],
  "$defs": {
    "ChallengeQuestion": {
      "type": "object",
      "properties": {
        "call": {
          "type": "string",
          "description": "The exact request to make, method and URL."
        },
        "ask": {
          "type": "string",
          "description": "What to read out of that response, in plain English."
        }
      },
      "required": [
        "call",
        "ask"
      ]
    }
  }
}