{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wenmarpro-com/json-schema/wenmarpro-com-vehicle-complaints-schema.json",
  "title": "VehicleComplaints",
  "description": "What owners reported to NHTSA about one model year, as counts.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wenmarpro-com-open-openapi.json#/components/schemas/VehicleComplaints",
  "type": "object",
  "required": [
    "vehicle",
    "verified",
    "complaints",
    "crashes",
    "fires",
    "injuries",
    "components",
    "note",
    "report_url",
    "attribution"
  ],
  "properties": {
    "as_of": {
      "type": [
        "string",
        "null"
      ],
      "description": "The day the complaints were current."
    },
    "attribution": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "complaints": {
      "type": "integer",
      "format": "int32",
      "description": "Every complaint about the model year. Not a rate: a model that\nsold more has more.",
      "minimum": 0
    },
    "components": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ComponentComplaints"
      },
      "description": "The components with at least five complaints, most first, at most\ntwelve. They do not add up to `complaints`: a complaint may name\nseveral, and a part is counted under its system too."
    },
    "crashes": {
      "type": "integer",
      "format": "int32",
      "minimum": 0
    },
    "fires": {
      "type": "integer",
      "format": "int32",
      "minimum": 0
    },
    "injuries": {
      "type": "integer",
      "format": "int32",
      "minimum": 0
    },
    "median_km": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "minimum": 0
    },
    "median_miles": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32",
      "minimum": 0
    },
    "note": {
      "type": "string",
      "description": "What these counts are and are not."
    },
    "report_url": {
      "type": "string",
      "description": "Where an owner files a complaint with NHTSA."
    },
    "vehicle": {
      "$ref": "#/$defs/RecallVehicle"
    },
    "verified": {
      "type": "boolean",
      "description": "Always `false`. A complaint is an owner's report. Nobody has\nverified it, and a count of complaints is not a finding that\nanything is wrong with the vehicle."
    }
  },
  "$defs": {
    "ComponentComplaints": {
      "type": "object",
      "description": "The complaints of a model year that name one component.",
      "required": [
        "id",
        "name",
        "complaints",
        "crashes",
        "fires",
        "injuries"
      ],
      "properties": {
        "complaints": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        },
        "crashes": {
          "type": "integer",
          "format": "int32",
          "description": "Complaints that report a crash.",
          "minimum": 0
        },
        "fires": {
          "type": "integer",
          "format": "int32",
          "description": "Complaints that report a fire.",
          "minimum": 0
        },
        "id": {
          "type": "string",
          "description": "A component id, such as `steering` or `brake-pad`."
        },
        "injuries": {
          "type": "integer",
          "format": "int32",
          "description": "Complaints that report at least one person injured.",
          "minimum": 0
        },
        "median_km": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "The median of the mileages owners gave, in kilometres. `null` when\nfewer than five gave one.",
          "minimum": 0
        },
        "median_miles": {
          "type": [
            "integer",
            "null"
          ],
          "format": "int32",
          "description": "The same in miles, as NHTSA records it.",
          "minimum": 0
        },
        "name": {
          "type": "string"
        },
        "parent": {
          "type": [
            "string",
            "null"
          ],
          "description": "The system a part belongs to. `null` for a system."
        }
      }
    },
    "RecallVehicle": {
      "type": "object",
      "description": "The model year an answer is about.",
      "required": [
        "id",
        "year",
        "make",
        "model"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The id of the year, make and model."
        },
        "make": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "year": {
          "type": "integer",
          "format": "int32",
          "minimum": 0
        }
      }
    }
  }
}