{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/valjeanspecialty/json-schema/valjeanspecialty-requirements-schema.json",
  "title": "Requirements",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/valjeanspecialty-requirements-api-openapi.yml#/components/schemas/Requirements",
  "type": "object",
  "properties": {
    "class_matched": {
      "type": [
        "string",
        "null"
      ]
    },
    "state": {
      "type": "string"
    },
    "lines": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "items": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/RequirementItem"
      }
    }
  },
  "required": [
    "class_matched",
    "state",
    "lines",
    "items"
  ],
  "$defs": {
    "AnswerSpec": {
      "type": "object",
      "properties": {
        "type": {
          "type": "string",
          "description": "How to answer. \"file\" means upload a document instead.",
          "enum": [
            "text",
            "number",
            "money",
            "percent",
            "yes_no",
            "choice",
            "date",
            "file"
          ]
        },
        "options": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "For type \"choice\": the allowed answers."
        }
      },
      "required": [
        "type"
      ]
    },
    "RequirementItem": {
      "type": "object",
      "properties": {
        "key": {
          "type": "string",
          "description": "Answer by this key later (PATCH /submissions/{id}/answers)."
        },
        "label": {
          "type": "string"
        },
        "type": {
          "type": "string",
          "description": "Playbook item type: document, field, question or photo.",
          "x-todo": "Market-only asks report \"document\" here even when they are questions; see level vocabulary note."
        },
        "level": {
          "type": "string",
          "description": "How much it matters.",
          "enum": [
            "required",
            "sometimes",
            "recommended",
            "some markets"
          ],
          "x-todo": "Three vocabularies exist (requirements: required/sometimes/recommended/some markets; needs: required/recommended; class guides: required/sometimes/helpful). Confirm the intended set."
        },
        "help": {
          "type": [
            "string",
            "null"
          ]
        },
        "answer": {
          "$ref": "#/$defs/AnswerSpec"
        }
      },
      "required": [
        "key",
        "label",
        "type",
        "level",
        "help",
        "answer"
      ]
    }
  }
}