{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tachlestools-com/json-schema/tachlestools-com-is-workday-schema.json",
  "title": "IsWorkday",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tachlestools-com-openapi.json#/components/schemas/IsWorkday",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "calendar",
    "date",
    "weekday",
    "is_workday",
    "reason",
    "holiday"
  ],
  "properties": {
    "calendar": {
      "$ref": "#/$defs/CalendarUsed"
    },
    "date": {
      "type": "string",
      "format": "date"
    },
    "weekday": {
      "$ref": "#/$defs/Weekday"
    },
    "is_workday": {
      "type": "boolean"
    },
    "reason": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "weekend",
        "holiday",
        "day_off",
        null
      ],
      "description": "Why it is not a working day; `null` when it is one."
    },
    "holiday": {
      "type": [
        "string",
        "null"
      ],
      "description": "The public holiday on this date, if there is one (also given when it falls on a weekend)."
    }
  },
  "$defs": {
    "CalendarUsed": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "id",
        "name",
        "weekend"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The calendar id, or `none`."
        },
        "name": {
          "type": "string"
        },
        "weekend": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Weekday"
          },
          "description": "The weekly days off that were used."
        }
      },
      "description": "The calendar and weekend the answer was worked out with, so you can check it."
    },
    "Weekday": {
      "type": "string",
      "enum": [
        "Sunday",
        "Monday",
        "Tuesday",
        "Wednesday",
        "Thursday",
        "Friday",
        "Saturday"
      ]
    }
  }
}