{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entur/json-schema/entur-change-option-schema.json",
  "title": "ChangeOption",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-change-options-api-openapi.yml#/components/schemas/ChangeOption",
  "required": [
    "orderId",
    "orderLineOptions"
  ],
  "type": "object",
  "properties": {
    "orderId": {
      "type": "string"
    },
    "orderLineOptions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OrderLineOptions"
      }
    }
  },
  "$defs": {
    "Fee": {
      "title": "Fee",
      "required": [
        "amount",
        "currency"
      ],
      "type": "object",
      "properties": {
        "amount": {
          "type": "string"
        },
        "currency": {
          "type": "string"
        }
      }
    },
    "Option": {
      "title": "Option",
      "required": [
        "id",
        "specifiedProducts",
        "types",
        "version"
      ],
      "type": "object",
      "properties": {
        "fee": {
          "$ref": "#/$defs/Fee"
        },
        "id": {
          "type": "string"
        },
        "legIds": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "specifiedProducts": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "default": []
        },
        "toFareClass": {
          "type": "string"
        },
        "types": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "ANY_PRODUCT",
              "SAME_PRODUCT",
              "DEPARTURE_SAME_DAY",
              "DEPARTURE_ANY_DAY",
              "SPECIFIED_PRODUCT",
              "SPECIFIED_FARE_CLASS",
              "SEAT_MAP",
              "TRANSFER_TICKET"
            ]
          },
          "default": []
        },
        "validFrom": {
          "type": "string",
          "format": "date-time"
        },
        "validTo": {
          "type": "string",
          "format": "date-time"
        },
        "version": {
          "type": "string"
        }
      }
    },
    "OrderLineOptions": {
      "title": "OrderLineOptions",
      "required": [
        "options",
        "orderLineId"
      ],
      "type": "object",
      "properties": {
        "orderLineId": {
          "type": "string"
        },
        "options": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Option"
          }
        }
      },
      "description": "Holder for possible change options for a given order line"
    }
  }
}