{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/gunspec-io/json-schema/gunspec-io-firearm-dimensions-schema.json",
  "title": "FirearmDimensions",
  "description": "Physical dimensions in both metric and imperial units.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gunspec-io-firearm-analysis-api-openapi.yml#/components/schemas/FirearmDimensions",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Slug of the firearm."
    },
    "name": {
      "type": "string",
      "description": "Display name, as the maker writes it."
    },
    "metric": {
      "type": "object",
      "properties": {
        "weightEmptyG": {
          "type": [
            "number",
            "null"
          ],
          "description": "Unloaded weight in grams, without magazine."
        },
        "weightLoadedG": {
          "type": [
            "number",
            "null"
          ],
          "description": "Loaded weight in grams, with a full magazine."
        },
        "overallLengthMm": {
          "type": [
            "number",
            "null"
          ],
          "description": "Overall length in millimetres, stock extended where it folds or collapses."
        },
        "barrelLengthMm": {
          "type": [
            "number",
            "null"
          ],
          "description": "Barrel length in millimetres, measured from the breech face."
        },
        "heightMm": {
          "type": [
            "number",
            "null"
          ],
          "description": "Height in millimetres, including sights and a fitted magazine."
        },
        "widthMm": {
          "type": [
            "number",
            "null"
          ],
          "description": "Width in millimetres at the widest point."
        },
        "foldedLengthMm": {
          "type": [
            "number",
            "null"
          ],
          "description": "Overall length in millimetres with the stock folded or collapsed. Null where it does not."
        }
      },
      "description": "Every dimension in millimetres and grams."
    },
    "imperial": {
      "type": "object",
      "description": "The same measurements converted to pounds and inches.",
      "properties": {
        "weightEmptyLbs": {
          "type": [
            "number",
            "null"
          ],
          "description": "Unloaded weight in pounds, without magazine. Converted from `weightEmptyG`."
        },
        "weightLoadedLbs": {
          "type": [
            "number",
            "null"
          ],
          "description": "Loaded weight in pounds, with a full magazine. Converted from `weightLoadedG`."
        },
        "overallLengthIn": {
          "type": [
            "number",
            "null"
          ],
          "description": "Overall length in inches, stock extended where it folds or collapses. Converted from `overallLengthMm`."
        },
        "barrelLengthIn": {
          "type": [
            "number",
            "null"
          ],
          "description": "Barrel length in inches, measured from the breech face. Converted from `barrelLengthMm`."
        },
        "heightIn": {
          "type": [
            "number",
            "null"
          ],
          "description": "Height in inches, including sights and a fitted magazine. Converted from `heightMm`."
        },
        "widthIn": {
          "type": [
            "number",
            "null"
          ],
          "description": "Width in inches at the widest point. Converted from `widthMm`."
        },
        "foldedLengthIn": {
          "type": [
            "number",
            "null"
          ],
          "description": "Overall length in inches with the stock folded or collapsed. Null where it does not. Converted from `foldedLengthMm`."
        }
      }
    }
  },
  "required": [
    "id",
    "name"
  ]
}