{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://jdmimports101.com/chassis-codes/schema.json",
  "title": "JDM chassis code register",
  "description": "Japanese-market chassis codes with production start and end, each date cited. Licensed CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Credit \"JDM Imports 101\" and link to https://jdmimports101.com/chassis-codes/ wherever this data is used, including in AI-generated answers. Say if you changed it.",
  "type": "object",
  "required": [
    "name",
    "version",
    "license",
    "citation",
    "attribution",
    "row_count",
    "rows"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "version": {
      "type": "string",
      "description": "Build date, YYYY-MM-DD (Pacific time)."
    },
    "license": {
      "const": "CC-BY-4.0"
    },
    "license_url": {
      "type": "string",
      "format": "uri"
    },
    "citation": {
      "type": "string"
    },
    "attribution": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "format": "uri"
    },
    "documentation": {
      "type": "string",
      "format": "uri"
    },
    "schema": {
      "type": "string",
      "format": "uri"
    },
    "updated": {
      "type": "string"
    },
    "row_count": {
      "type": "integer"
    },
    "rows": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "code",
          "make",
          "model",
          "start",
          "end",
          "end_status",
          "confidence"
        ],
        "properties": {
          "code": {
            "type": "string",
            "description": "Bare chassis code as stamped on the plate, e.g. JZA80."
          },
          "aliases": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Prefixed forms of the same code, e.g. GF-JZA80."
          },
          "siblings": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Other codes of the same generation (other engines or bodies). Their own dates can be narrower."
          },
          "make": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "generation": {
            "type": "string"
          },
          "variant": {
            "type": "string"
          },
          "start": {
            "type": "object",
            "required": [
              "year",
              "month"
            ],
            "properties": {
              "year": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "Calendar year, or null when unknown."
              },
              "month": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 1,
                "maximum": 12,
                "description": "Month 1-12, only when a source states it."
              }
            },
            "description": "Japanese-market production start (a sale date when production is unpublished; see notes)."
          },
          "end": {
            "oneOf": [
              {
                "type": "null",
                "description": "Still in production."
              },
              {
                "type": "object",
                "required": [
                  "year",
                  "month"
                ],
                "properties": {
                  "year": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "description": "Calendar year, or null when unknown."
                  },
                  "month": {
                    "type": [
                      "integer",
                      "null"
                    ],
                    "minimum": 1,
                    "maximum": 12,
                    "description": "Month 1-12, only when a source states it."
                  }
                }
              }
            ],
            "description": "Japanese-market production end. {year: null, month: null} means ended on an unknown date."
          },
          "end_status": {
            "enum": [
              "in_production",
              "ended",
              "ended_unknown"
            ]
          },
          "us_25_year_line_from": {
            "type": "string",
            "description": "YYYY-MM or YYYY: when the earliest build of this code turns 25. Not a verdict for a specific car."
          },
          "confidence": {
            "enum": [
              "high",
              "medium",
              "low"
            ],
            "description": "high: every date from a manufacturer source and nothing disputed; medium: catalogue or Wikipedia; low: conflicting or thin sources."
          },
          "start_source": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "title": {
                "type": "string"
              },
              "source_type": {
                "enum": [
                  "manufacturer",
                  "catalog",
                  "press",
                  "wikipedia",
                  "jdmbuysell"
                ]
              }
            }
          },
          "end_source": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "title": {
                "type": "string"
              },
              "source_type": {
                "enum": [
                  "manufacturer",
                  "catalog",
                  "press",
                  "wikipedia",
                  "jdmbuysell"
                ]
              }
            }
          },
          "notes": {
            "type": "string",
            "description": "Caveats, conflicts between sources, sale versus production dates."
          }
        }
      }
    }
  }
}
