{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/car-gene-com/json-schema/car-gene-com-model-relation-input-schema.json",
  "title": "ModelRelationInput",
  "description": "世代どうしのつながり1行（`model_relations`）\n\n**端点のシリーズを受け取らない。** `from_series_id` / `to_series_id` は\n複合 FK が保証する非正規化で「投入側の申告ではない」（列のコメント）。\n世代 id から gateway が引く。\n\n**`kind` を Enum にしない。** 使える値を持つのはマスタ\n(`model_relation_kinds`) の行で、ここに並べ直すと種別を足すたびに backend も\n直すことになる（`EngineerLinkInput.role_code` と同じ）。知らないコードは\nFK 違反として 422 で返る。\n\n**出典と根拠の「要否」は書かない。** 条件は DB の check に1か所だけ置いて\nある（`model_relations_official_needs_source` /\n`model_relations_non_direct_needs_rationale`）。同じシリーズの中の直系かは\n世代を引くまで決まらないので、ここで判定すると条件が2つに割れる。落ちた\n理由は gateway が日本語に訳して返す。\n\n**ここで見るのは、DB に置き場が無い決まりだけ**——出典が URL と逐語で1組か、\n根拠を書ける種別か。どちらも「その値が要るか」ではなく値どうしの関係で、\nDB の check には無い（投入口だけが持っていた）。**入口ごとに厳しさを\n変えない**（#829）。",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/car-gene-com-openapi.yml#/components/schemas/ModelRelationInput",
  "properties": {
    "kind": {
      "type": "string",
      "title": "Kind"
    },
    "from_model_id": {
      "type": "string",
      "title": "From Model Id"
    },
    "to_model_id": {
      "type": "string",
      "title": "To Model Id"
    },
    "source_url": {
      "type": "string",
      "title": "Source Url"
    },
    "source_excerpt": {
      "type": "string",
      "title": "Source Excerpt"
    },
    "rationale": {
      "type": "string",
      "title": "Rationale"
    },
    "note": {
      "type": "string",
      "title": "Note"
    },
    "source_publisher": {
      "type": "string",
      "title": "Source Publisher"
    },
    "source_tier": {
      "type": "string",
      "enum": [
        "primary",
        "secondary"
      ],
      "title": "Source Tier"
    }
  },
  "type": "object",
  "required": [
    "kind",
    "from_model_id",
    "to_model_id"
  ]
}