{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/robottraining-jobs/main/json-schema/robottraining-jobs-pay-document-schema.json",
  "title": "PayDocument",
  "x-generated": "2026-10-15",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robottraining-jobs-openapi.json#/components/schemas/PayDocument",
  "allOf": [
    {
      "$ref": "#/$defs/DocumentInfo"
    },
    {
      "type": "object",
      "properties": {
        "pay_by_work_type": {
          "type": "array",
          "items": {
            "allOf": [
              {
                "$ref": "#/$defs/PayBand"
              },
              {
                "type": "object",
                "properties": {
                  "slug": {
                    "type": "string"
                  },
                  "label": {
                    "type": "string"
                  },
                  "open_total": {
                    "type": "integer",
                    "description": "Open roles of that kind."
                  },
                  "unpriced": {
                    "type": "integer",
                    "description": "Open roles of that kind that state no rate."
                  }
                }
              }
            ]
          }
        }
      }
    }
  ],
  "$defs": {
    "DocumentInfo": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "source": {
          "type": "string",
          "format": "uri",
          "description": "The page that renders the same numbers."
        },
        "license": {
          "type": "string",
          "format": "uri"
        },
        "measurement_technique": {
          "type": "string"
        },
        "updated": {
          "type": "string",
          "format": "date-time",
          "description": "When the job feeds were last read (UTC)."
        },
        "temporal_coverage": {
          "type": "string",
          "format": "date",
          "description": "The day the figures describe. Cite this date."
        }
      }
    },
    "PayBand": {
      "type": "object",
      "properties": {
        "currency": {
          "type": [
            "string",
            "null"
          ]
        },
        "unit": {
          "type": [
            "string",
            "null"
          ]
        },
        "median": {
          "type": [
            "number",
            "null"
          ]
        },
        "typical_low": {
          "type": [
            "number",
            "null"
          ],
          "description": "25th percentile of advertised rates."
        },
        "typical_high": {
          "type": [
            "number",
            "null"
          ],
          "description": "75th percentile of advertised rates."
        },
        "rate_samples": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Distinct advertised rates measured, after removing relistings."
        },
        "platforms": {
          "type": [
            "integer",
            "null"
          ],
          "description": "Platforms advertising those rates."
        }
      }
    }
  }
}