{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://openjuvenile.org/schemas/v0.1/profiles/car-seat.schema.json",
  "title": "Category profile – car seats",
  "description": "Fields for child car seats (category code car-seat), based on the vehicle approval under UN R129 (i-Size). UN R44 is accepted for existing data only.",
  "$comment": "TODO(review): the levels of the profile fields are a first proposal for the working group Strollers & car seats.",
  "type": "object",
  "properties": {
    "approvalRegulation": {
      "description": "Regulation the seat is approved under. UN R44 only for data on existing products.",
      "type": "string",
      "enum": ["UN R129", "UN R44"],
      "examples": ["UN R129"]
    },
    "approvalNumber": {
      "description": "Approval number as shown on the approval label of the seat.",
      "type": "string",
      "minLength": 1,
      "examples": ["E4 129R-03/0000"]
    },
    "heightRangeCm": {
      "description": "Range of the child's height (stature) the seat is approved for, in cm.",
      "type": "object",
      "properties": {
        "min": {
          "description": "Minimum height in cm.",
          "type": "number",
          "exclusiveMinimum": 0,
          "examples": [40]
        },
        "max": {
          "description": "Maximum height in cm.",
          "type": "number",
          "exclusiveMinimum": 0,
          "examples": [87]
        }
      },
      "required": ["min", "max"],
      "additionalProperties": false
    },
    "maxChildWeightKg": {
      "description": "Maximum weight of the child in kg, where the approval states one.",
      "type": "number",
      "exclusiveMinimum": 0,
      "x-openjuvenile-level": "should",
      "examples": [13]
    },
    "orientation": {
      "description": "Direction of travel in which the seat can be installed.",
      "type": "string",
      "enum": ["rearward", "forward", "both"],
      "examples": ["rearward"]
    },
    "installation": {
      "description": "How the seat is fixed in the vehicle.",
      "type": "string",
      "enum": ["isofix", "belt", "isofix-and-belt"],
      "examples": ["isofix-and-belt"]
    },
    "supportLeg": {
      "description": "Whether the seat or its base has a support leg.",
      "type": "boolean",
      "x-openjuvenile-level": "should",
      "examples": [true]
    },
    "topTether": {
      "description": "Whether the seat uses a top tether strap.",
      "type": "boolean",
      "x-openjuvenile-level": "should",
      "examples": [false]
    },
    "rotation": {
      "description": "Whether the seat shell rotates for getting the child in and out.",
      "type": "boolean",
      "x-openjuvenile-level": "may",
      "examples": [false]
    },
    "vehicleTypeApproval": {
      "description": "universal: fits vehicles with the corresponding seating positions · specific-vehicle: approved for the vehicles in a vehicle list.",
      "type": "string",
      "enum": ["universal", "specific-vehicle"],
      "x-openjuvenile-level": "should",
      "examples": ["universal"]
    },
    "vehicleListUrl": {
      "$ref": "../core.schema.json#/$defs/url",
      "description": "Link to the manufacturer's vehicle list.",
      "x-openjuvenile-level": "conditional",
      "x-openjuvenile-condition": "vehicleTypeApproval is specific-vehicle."
    }
  },
  "required": [
    "approvalRegulation",
    "approvalNumber",
    "heightRangeCm",
    "orientation",
    "installation"
  ],
  "patternProperties": {
    "^x-": {
      "description": "Extension fields. Names start with x- and are ignored by consumers that do not know them."
    }
  },
  "additionalProperties": false,
  "if": {
    "properties": { "vehicleTypeApproval": { "const": "specific-vehicle" } },
    "required": ["vehicleTypeApproval"]
  },
  "then": { "required": ["vehicleListUrl"] }
}
