{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/entur/json-schema/entur-entitlement-required-request-schema.json",
  "title": "EntitlementRequiredRequest",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/entur-entitlement-required-api-openapi.yml#/components/schemas/EntitlementRequiredRequest",
  "required": [
    "entitlementType",
    "fareProductRef",
    "name"
  ],
  "type": "object",
  "properties": {
    "name": {
      "$ref": "#/$defs/LocalizedString"
    },
    "entitlementType": {
      "type": "string",
      "description": "The type of entitlement that is required.",
      "enum": [
        "SINGLE_TRIP",
        "PERIOD_PASS",
        "DAY_PASS",
        "CARNET"
      ]
    },
    "fareProductRef": {
      "pattern": "^([A-Z]{3}):PreassignedFareProduct:([0-9A-Za-z_\\-]*)$",
      "type": "string",
      "description": "Reference to the fare product that satisfies this entitlement."
    }
  },
  "$defs": {
    "LocalizedString": {
      "type": "array",
      "items": {
        "required": [
          "lang",
          "value"
        ],
        "type": "object",
        "properties": {
          "lang": {
            "pattern": "^[a-z]{2}-[A-Z]{2}$",
            "type": "string",
            "description": "BCP-47 language tag (e.g., 'nb-NO', 'en-GB')."
          },
          "value": {
            "type": "string",
            "description": "The localized string value for the specified lang."
          }
        }
      }
    }
  }
}