{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/wenmarpro-com/json-schema/wenmarpro-com-code-schema.json",
  "title": "Code",
  "description": "One generic trouble code, described in this project's own words.",
  "x-generated": "2026-11-28",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/wenmarpro-com-open-openapi.json#/components/schemas/Code",
  "type": "object",
  "required": [
    "code",
    "generic",
    "system",
    "system_name",
    "title",
    "meaning",
    "common_causes",
    "checks",
    "components",
    "related",
    "reviewer",
    "checked",
    "url",
    "note",
    "attribution"
  ],
  "properties": {
    "attribution": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The credit lines the data's licences ask for."
    },
    "checked": {
      "type": "string",
      "description": "The day it was approved."
    },
    "checks": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "What a technician usually verifies first."
    },
    "code": {
      "type": "string"
    },
    "common_causes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "General causes, not about one make."
    },
    "components": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CodeComponent"
      }
    },
    "generic": {
      "type": "boolean",
      "description": "Always `true` here: only codes every maker uses the same way are\ndescribed."
    },
    "meaning": {
      "type": "string",
      "description": "What the code tells a service advisor."
    },
    "note": {
      "type": "string",
      "description": "What a description is and is not."
    },
    "related": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/CodeLink"
      },
      "description": "Related codes that are described too."
    },
    "reviewer": {
      "type": "string",
      "description": "The GitHub name of the person who approved the text."
    },
    "system": {
      "type": "string"
    },
    "system_name": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "url": {
      "type": "string"
    }
  },
  "$defs": {
    "CodeComponent": {
      "type": "object",
      "description": "A component a trouble code concerns.",
      "required": [
        "id",
        "name"
      ],
      "properties": {
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "parent": {
          "type": [
            "string",
            "null"
          ],
          "description": "The system a part belongs to. `null` for a system."
        }
      }
    },
    "CodeLink": {
      "type": "object",
      "description": "A trouble code in a list.",
      "required": [
        "code",
        "system",
        "title",
        "url"
      ],
      "properties": {
        "code": {
          "type": "string"
        },
        "system": {
          "type": "string",
          "description": "Where the index lists it: a group (`powertrain`, `body`, `chassis`,\n`network`), or a group and an area of it."
        },
        "title": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "description": "The code's page on this site."
        }
      }
    }
  }
}