{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entur/json-schema/entur-day-type-schema.json",
  "title": "DayType",
  "description": "The DayType describe during which the assignment applies",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-day-types-api-openapi.yml#/components/schemas/DayType",
  "required": [
    "changed",
    "created",
    "id",
    "modification",
    "nameOfClass",
    "status",
    "version"
  ],
  "type": "object",
  "properties": {
    "changed": {
      "type": "string",
      "description": "Changed datetime.",
      "readOnly": true
    },
    "created": {
      "type": "string",
      "description": "Created datetime.",
      "readOnly": true
    },
    "dayLength": {
      "type": "string",
      "description": "Day length.  Represented as a string formatted according to ISO-8601"
    },
    "description": {
      "type": "array",
      "description": "Description of day type",
      "items": {
        "$ref": "#/$defs/TextInLanguage"
      }
    },
    "durationAfterPropertiesOfDay": {
      "type": "string",
      "description": "Duration after properties of day. Represented as a string formatted according to ISO-8601"
    },
    "durationBeforePropertiesOfDay": {
      "type": "string",
      "description": "Duration before properties of day. Represented as a string formatted according to ISO-8601"
    },
    "earliestTime": {
      "type": "string",
      "description": "Earliest time."
    },
    "id": {
      "minLength": 1,
      "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
      "type": "string",
      "description": "Id."
    },
    "modification": {
      "type": "string",
      "description": "Modification status.",
      "readOnly": true,
      "enum": [
        "NEW",
        "REVISE",
        "DELETE"
      ]
    },
    "name": {
      "type": "array",
      "description": "Name of day type",
      "items": {
        "$ref": "#/$defs/TextInLanguage"
      }
    },
    "nameOfClass": {
      "type": "string",
      "description": "Name of class.",
      "readOnly": true
    },
    "properties": {
      "type": "array",
      "description": "Properties of day",
      "items": {
        "$ref": "#/$defs/PropertyOfDay"
      }
    },
    "status": {
      "type": "string",
      "description": "Status.",
      "readOnly": true,
      "enum": [
        "DRAFT",
        "PROPOSED",
        "VERSIONED",
        "DEPRECATED"
      ]
    },
    "timebandRefs": {
      "type": "array",
      "description": "Time band references.",
      "items": {
        "$ref": "#/$defs/VersionOfObjectRef"
      }
    },
    "version": {
      "minLength": 1,
      "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
      "type": "string",
      "description": "Version."
    }
  },
  "$defs": {
    "PropertyOfDay": {
      "required": [
        "countryRef",
        "name"
      ],
      "type": "object",
      "properties": {
        "countryRef": {
          "type": "string",
          "description": "Reference to country for holiday. ISO 3166-1",
          "readOnly": true
        },
        "dayOfYear": {
          "type": "string",
          "description": "Day of year",
          "format": "##-##"
        },
        "daysOfWeek": {
          "type": "array",
          "description": "Days of week",
          "items": {
            "type": "string"
          }
        },
        "description": {
          "type": "string",
          "description": "Description of the property of day"
        },
        "holidayTypes": {
          "type": "array",
          "description": "Holiday types",
          "items": {
            "type": "string"
          }
        },
        "monthOfYear": {
          "type": "integer",
          "description": "Month of year",
          "format": "int32",
          "enum": [
            1,
            2,
            3,
            4,
            5,
            6,
            7,
            8,
            9,
            10,
            11,
            12
          ]
        },
        "name": {
          "type": "string",
          "description": "Name of property of day"
        }
      },
      "description": "The DayType describe during which the assignment applies"
    },
    "TextInLanguage": {
      "required": [
        "lang",
        "value"
      ],
      "type": "object",
      "properties": {
        "lang": {
          "minLength": 1,
          "type": "string",
          "description": "Language code."
        },
        "value": {
          "minLength": 1,
          "type": "string",
          "description": "The text."
        }
      },
      "description": "Text in a specific language."
    },
    "VersionOfObjectRef": {
      "required": [
        "nameOfClass",
        "ref",
        "version"
      ],
      "type": "object",
      "properties": {
        "nameOfClass": {
          "minLength": 1,
          "type": "string",
          "description": "Name of class."
        },
        "ref": {
          "minLength": 1,
          "pattern": "^([A-Z]{3}):([A-Za-z]*):([0-9A-Za-z_\\-]*)$",
          "type": "string",
          "description": "The netex id reference to the object."
        },
        "version": {
          "type": "string",
          "description": "Version."
        }
      },
      "description": "Fare frame ref."
    }
  }
}