Menu

JSON Schema

Complete JSON Schema (draft-07) for validating Splice harness data. Use this schema for validation in any language that supports JSON Schema.

Root Schema

{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Splice Harness Schema",
  "description": "Complete schema for Splice cable harness data structure",
  "type": "object",
  "properties": {
    "bom": {
      "type": "object",
      "description": "Bill of Materials with expanded part data",
      "additionalProperties": {
        "$ref": "#/definitions/ExpandedBomItem"
      }
    },
    "data": {
      "$ref": "#/definitions/WorkingData"
    },
    "harness_id": {
      "type": "string",
      "format": "uuid",
      "description": "UUID of the harness if saved"
    },
    "revision_id": {
      "type": "string",
      "format": "uuid",
      "description": "UUID of the harness revision if saved"
    }
  },
  "required": ["bom", "data"]
}

Enum Definitions

{
  "PartKind": {
    "type": "string",
    "enum": ["connector", "terminal", "wire", "cable", "assembly"]
  },
  "Gender": {
    "type": "string",
    "enum": ["male", "female", "none"]
  },
  "ConnectorShape": {
    "type": "string",
    "enum": [
      "circular", "rectangular", "dsub", "terminal_block",
      "ferrule", "quickdisconnect", "ring", "button",
      "spade", "lug", "usb", "barrel", "header", "coaxial", "rj",
      "other"
    ]
  },
  "ConductorType": {
    "type": "string",
    "enum": ["solid", "stranded"]
  },
  "ConnectionSide": {
    "type": "string",
    "enum": ["left", "right"]
  },
  "TerminationType": {
    "type": "string",
    "enum": ["tinned", "bare", "heat_shrink"]
  }
}

BOM Item Definitions

{
  "ExpandedBomItem": {
    "type": "object",
    "properties": {
      "instance_id": { "type": "string" },
      "part": { "$ref": "#/definitions/Part" },
      "unit": { "type": "string" }
    },
    "required": ["instance_id", "part", "unit"]
  },
  "Part": {
    "type": "object",
    "properties": {
      "id": { "type": "string", "format": "uuid" },
      "kind": { "$ref": "#/definitions/PartKind" },
      "mpn": { "type": "string" },
      "manufacturer": { "type": "string" },
      "description": { "type": "string" },
      "img_url": { "type": "string", "format": "uri" },
      "datasheet_url": { "type": "string", "format": "uri" },
      "created_at": { "type": "string", "format": "date-time" },
      "spec": { "type": "object" }
    },
    "required": ["id", "kind", "mpn", "manufacturer"]
  }
}

Connector Spec Definition

{
  "ConnectorSpec": {
    "type": "object",
    "properties": {
      "color": { "type": "string" },
      "contact_gender": { "$ref": "#/definitions/Gender" },
      "contact_termination": { "type": "string" },
      "fastening_type": { "type": "string" },
      "features": { "type": "array", "items": { "type": "string" } },
      "insulation_material": { "type": "string" },
      "mounting_type": { "type": "string" },
      "operating_temp_f": { "type": "string" },
      "pitch_mm": { "type": "number" },
      "positions": { "type": "integer", "minimum": 1 },
      "rows": { "type": "integer", "minimum": 1 },
      "series": { "type": "string" },
      "shape": { "$ref": "#/definitions/ConnectorShape" },
      "wire_awg_min": { "type": "integer" },
      "wire_awg_max": { "type": "integer" },
      "keying_code": { "type": "string" },
      "bridged_positions": {
        "type": "array",
        "items": { "type": "array", "items": { "type": "integer" } }
      },
      "is_custom": { "type": "boolean" },
      "custom_svg": { "$ref": "#/definitions/CustomConnectorSvg" },
      "pin_mapping": { "type": "object", "additionalProperties": true }
    },
    "required": ["positions"]
  }
}

Wire and Cable Spec Definitions

{
  "WireSpec": {
    "type": "object",
    "properties": {
      "awg": { "type": "integer" },
      "stranding": { "type": ["string", "null"] },
      "color": { "type": ["string", "null"] },
      "stripe": { "type": ["string", "null"] },
      "conductor_type": { "$ref": "#/definitions/ConductorType" }
    },
    "required": ["conductor_type"]
  },
  "CableSpec": {
    "type": "object",
    "properties": {
      "core_count": { "type": "integer" },
      "cores": { "type": "array", "items": { "$ref": "#/definitions/CableCore" } },
      "shielded": { "type": "boolean" },
      "shield_type": { "type": "string" },
      "outer_diameter_mm": { "type": "number" },
      "voltage_rating": { "type": "number" },
      "default_length_m": { "type": "number" },
      "jacket_material": { "type": "string" },
      "temperature_rating_c": { "type": "number" },
      "flexibility": { "type": "string" }
    }
  },
  "CableCore": {
    "type": "object",
    "properties": {
      "core_no": { "type": "integer" },
      "core_designation": { "type": ["string", "null"] },
      "awg": { "type": ["integer", "null"] },
      "stranding": { "type": ["string", "null"] },
      "core_color": { "type": ["string", "null"] },
      "conductor_type": { "$ref": "#/definitions/ConductorType" }
    },
    "required": ["core_no"]
  }
}

Working Data Definition

{
  "WorkingData": {
    "type": "object",
    "properties": {
      "mapping": {
        "type": "object",
        "description": "Wire/cable connections mapping",
        "additionalProperties": { "$ref": "#/definitions/Connection" }
      },
      "connector_positions": {
        "type": "object",
        "description": "Connector positions on canvas",
        "additionalProperties": { "$ref": "#/definitions/Position" }
      },
      "wire_anchors": {
        "type": "object",
        "description": "Wire routing anchor points",
        "additionalProperties": { "$ref": "#/definitions/Position" }
      },
      "cable_positions": {
        "type": "object",
        "description": "Cable positions on canvas",
        "additionalProperties": { "$ref": "#/definitions/Position" }
      },
      "design_notes": {
        "type": "array",
        "items": { "$ref": "#/definitions/DesignNote" }
      },
      "bundle_labels": {
        "type": "object",
        "description": "Labels for connectors and cables",
        "additionalProperties": { "$ref": "#/definitions/BundleLabel" }
      },
      "name": { "type": ["string", "null"] },
      "description": { "type": ["string", "null"] },
      "notes": { "type": ["string", "null"] }
    },
    "required": ["mapping", "connector_positions", "wire_anchors"]
  }
}

Connection Definition

{
  "Connection": {
    "type": "object",
    "properties": {
      "end1": { "$ref": "#/definitions/ConnectionTermination" },
      "end2": { "$ref": "#/definitions/ConnectionTermination" },
      "label": { "type": "string" },
      "length_mm": { "type": "number" }
    }
  },
  "ConnectionTermination": {
    "type": "object",
    "properties": {
      "type": {
        "type": "string",
        "enum": ["connector_pin", "cable_core", "flying_lead"]
      }
    },
    "required": ["type"]
  },
  "Position": {
    "type": "object",
    "properties": {
      "x": { "type": "number" },
      "y": { "type": "number" },
      "width": { "type": "number" },
      "height": { "type": "number" },
      "collapsed": { "type": "boolean" },
      "hidden": { "type": "boolean" }
    },
    "required": ["x", "y"]
  }
}

JSON Example

{
  "bom": {
    "X1": {
      "instance_id": "X1",
      "part": {
        "id": "12345678-1234-1234-1234-123456789abc",
        "kind": "connector",
        "mpn": "09-50-1031",
        "manufacturer": "Molex",
        "description": "3 Position Wire to Board Connector",
        "spec": {
          "connector": {
            "positions": 3,
            "rows": 1,
            "shape": "rectangular",
            "contact_gender": "female",
            "pitch_mm": 2.54
          }
        }
      },
      "unit": "each"
    },
    "W1": {
      "instance_id": "W1",
      "part": {
        "id": "11111111-2222-3333-4444-555555555555",
        "kind": "wire",
        "mpn": "AWG22-RED",
        "manufacturer": "Generic",
        "description": "22 AWG Stranded Wire, Red",
        "spec": {
          "wire": {
            "awg": 22,
            "stranding": "7/30",
            "color": "red",
            "conductor_type": "stranded"
          }
        }
      },
      "unit": "ft"
    }
  },
  "data": {
    "mapping": {
      "W1": {
        "end1": {
          "type": "connector_pin",
          "connector_instance": "X1",
          "pin": 1,
          "side": "right"
        },
        "end2": {
          "type": "flying_lead",
          "termination_type": "tinned",
          "strip_length_mm": 6,
          "tin_length_mm": 3
        },
        "label": "POWER",
        "length_mm": 152.4
      }
    },
    "connector_positions": {
      "X1": { "x": 100, "y": 200 }
    },
    "wire_anchors": {},
    "name": "Example Harness",
    "description": "Simple harness example"
  }
}