{
  "synthetic": true,
  "execution": "Teaching record only; no live integration tested",
  "slug": "json-duplicate-member-import-contract",
  "group": "content-data",
  "title": [
    "Reject ambiguous duplicate keys before importing JSON",
    "导入JSON前，先拒绝歧义重复键"
  ],
  "intro": [
    "A CMS import can carry two different prices under the same property name and still look like valid JSON to a reviewer. If one component keeps the first value and another keeps the last, agreement is lost before the record reaches the website. Define a duplicate-member policy at the raw-input boundary.",
    "CMS导入可能在同一属性名下写两个价格，人工看起来仍像合法JSON。一层保留首值、另一层保留末值时，记录到网站之前就已失去一致口径。应在原始输入边界规定重复成员处理。"
  ],
  "facts": [
    [
      "RFC8259 says object member names should be unique and describes differing receiver behaviour when they are duplicated. It does not require every JSON parser to reject them.",
      "RFC8259说明对象成员名应唯一，并列出重复时不同接收程序的差异；它并未要求所有解析器都拒绝重复键。",
      "https://www.rfc-editor.org/rfc/rfc8259#section-4"
    ]
  ],
  "example": [
    [
      [
        "{\"sku\":\"A\",\"price\":70,\"price\":90}",
        "Two price members in one object",
        "Reject under this import policy; do not choose70 or 90"
      ],
      [
        "{\"sku\":\"A\",\"price\":70,\"price\":90}",
        "同一对象有两个price",
        "按本导入规则拒绝，不擅选70或90"
      ]
    ],
    [
      [
        "{\"en\":{\"title\":\"A\"},\"zh\":{\"title\":\"甲\"}}",
        "Same name in different nested objects",
        "Not a duplicate in either object"
      ],
      [
        "{\"en\":{\"title\":\"A\"},\"zh\":{\"title\":\"甲\"}}",
        "不同嵌套对象各有title",
        "每个对象内部均不重复"
      ]
    ],
    [
      [
        "{\"sku\":\"A\",\"\\u0073ku\":\"B\"}",
        "Decode member names before comparison",
        "Duplicate sku in root object; reject"
      ],
      [
        "{\"sku\":\"A\",\"\\u0073ku\":\"B\"}",
        "先解码名称再比较",
        "根对象sku重复，拒绝"
      ]
    ],
    [
      [
        "JSON already parsed to an ordinary object",
        "Original duplicate was overwritten",
        "Cannot prove no duplicates from this object alone"
      ],
      [
        "JSON已转成普通对象",
        "原重复值被覆盖",
        "不能仅凭该对象证明没有重复"
      ]
    ]
  ],
  "steps": [
    [
      "Require the original UTF-8 payload or a validated intake receipt before destructive import. Keep raw-input checks separate from field-type and business-price validation.",
      "不可逆导入前保留原UTF-8请求或有效接收证明；原始结构检查与字段类型、业务价格核验分开。"
    ],
    [
      "Supply same-object, nested-object and escaped-name cases to a duplicate-aware parser. Require location and object path in the rejection output.",
      "向识别重复的解析器提供同对象、嵌套和转义名称案例；拒绝输出须带位置及对象路径。"
    ],
    [
      "Then validate the accepted schema and reconcile expected IDs/counts in a non-production import. A duplicate-free record can still have a wrong price.",
      "之后再验schema，并在非生产导入中核对ID和数量；没有重复键仍可能价格错误。"
    ]
  ],
  "result": [
    "Rejecting the first row preserves uncertainty instead of silently accepting a chosen price. The nested example prevents an overly broad “all keys must be globally unique” rule. A final object snapshot lacks the discarded bytes needed to assess the fourth row.",
    "拒绝首行是保留歧义，而不是悄悄挑一个价格；嵌套例避免错误要求“全文所有键都唯一”。末行的最终对象快照已没有被丢弃的字节。"
  ],
  "accept": [
    "A raw duplicate must fail before state changes, while legitimate nested repeated names remain allowed. Require a duplicate-aware implementation and error-path evidence, not a regular-expression search.",
    "原始重复须在改数据前失败，合法嵌套同名须保留；需要识别重复的实现及错误路径证据，不能只做正则搜索。"
  ],
  "limit": [
    "Synthetic import specification, not a production JSON parser or a price-authority audit. No catalogue, credentials, live data or schema is changed.",
    "合成导入规格，不是生产JSON解析器或价格权威审计；不改目录、凭证、真实数据或schema。"
  ],
  "oldLinks": []
}
