{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/tachlestools-com/json-schema/tachlestools-com-networkdays-schema.json",
  "title": "Networkdays",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/tachlestools-com-openapi.json#/components/schemas/Networkdays",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "calendar",
    "start",
    "end",
    "working_days",
    "calendar_days",
    "weekend_days",
    "holidays_on_workdays"
  ],
  "properties": {
    "calendar": {
      "$ref": "#/$defs/CalendarUsed"
    },
    "start": {
      "type": "string",
      "format": "date"
    },
    "end": {
      "type": "string",
      "format": "date"
    },
    "working_days": {
      "type": "integer",
      "description": "Negative when `end` is before `start`."
    },
    "calendar_days": {
      "type": "integer",
      "description": "All days in the range, both ends counted."
    },
    "weekend_days": {
      "type": "integer"
    },
    "holidays_on_workdays": {
      "type": "array",
      "description": "Public holidays and your days off that fell on working days, in date order.",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "date",
          "name",
          "weekday"
        ],
        "properties": {
          "date": {
            "type": "string",
            "format": "date"
          },
          "name": {
            "type": "string"
          },
          "weekday": {
            "$ref": "#/$defs/Weekday"
          }
        }
      }
    }
  },
  "$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"
      ]
    }
  }
}