{
  "samples": [
    {
      "id": "single-quotes",
      "bad": "{'name': 'YYSI'}",
      "fixed": "{\"name\": \"YYSI\"}",
      "cause_en": "JSON strings require double quotes; single quotes are not valid.",
      "cause_zh": "JSON 字符串必须用双引号，单引号无效。"
    },
    {
      "id": "trailing-comma-object",
      "bad": "{\"name\": \"YYSI\", \"year\": 2026,}",
      "fixed": "{\"name\": \"YYSI\", \"year\": 2026}",
      "cause_en": "A comma before the closing brace has no following key.",
      "cause_zh": "闭括号前的逗号后面没有新的键。"
    },
    {
      "id": "trailing-comma-array",
      "bad": "[\"news\", \"tools\",]",
      "fixed": "[\"news\", \"tools\"]",
      "cause_en": "A comma before the closing bracket has no following element.",
      "cause_zh": "闭方括号前的逗号后面没有新元素。"
    },
    {
      "id": "comment",
      "bad": "{\n  \"retries\": 3 // three attempts\n}",
      "fixed": "{\n  \"retries\": 3\n}",
      "cause_en": "JSON has no comments; / is invalid at value position.",
      "cause_zh": "JSON 不支持注释，值的位置出现 / 非法。"
    },
    {
      "id": "missing-brace",
      "bad": "{\"user\": {\"name\": \"Ada\", \"id\": 7}",
      "fixed": "{\"user\": {\"name\": \"Ada\", \"id\": 7}}",
      "cause_en": "The nested object was never closed; input ended too early.",
      "cause_zh": "嵌套对象没有闭合，输入提前结束。"
    },
    {
      "id": "missing-comma",
      "bad": "{\"a\": 1 \"b\": 2}",
      "fixed": "{\"a\": 1, \"b\": 2}",
      "cause_en": "Two key/value pairs need a comma between them.",
      "cause_zh": "两个键值对之间缺少逗号。"
    },
    {
      "id": "unescaped-quote",
      "bad": "{\"quote\": \"He said \"hi\" quickly\"}",
      "fixed": "{\"quote\": \"He said \\\"hi\\\" quickly\"}",
      "cause_en": "Inner double quotes must be escaped with backslash, or the string ends early.",
      "cause_zh": "字符串内部的引号必须用反斜杠转义，否则字符串提前结束。"
    },
    {
      "id": "raw-newline",
      "bad": "{\"text\": \"line1\nline2\"}",
      "fixed": "{\"text\": \"line1\\nline2\"}",
      "cause_en": "A literal newline inside a string is invalid; escape it as \\n.",
      "cause_zh": "字符串里不能直接换行，应写成 \\n 转义。"
    },
    {
      "id": "smart-quotes",
      "bad": "{\"name\": “YYSI”}",
      "fixed": "{\"name\": \"YYSI\"}",
      "cause_en": "Word-processor curly quotes look similar but are different characters.",
      "cause_zh": "办公软件的弯引号看起来像，但是不同字符。"
    },
    {
      "id": "leading-plus",
      "bad": "{\"delta\": +1}",
      "fixed": "{\"delta\": 1}",
      "cause_en": "JSON numbers cannot start with a plus sign.",
      "cause_zh": "JSON 数字不能以加号开头。"
    },
    {
      "id": "leading-zero",
      "bad": "{\"zip\": 007}",
      "fixed": "{\"zip\": \"007\"}",
      "cause_en": "Numbers cannot have leading zeros; if it is a code, store it as a string.",
      "cause_zh": "数字不能有前导零；编号类请存成字符串。"
    },
    {
      "id": "hex-number",
      "bad": "{\"mask\": 0x1F}",
      "fixed": "{\"mask\": 31}",
      "cause_en": "JSON has no hexadecimal notation; write the decimal value.",
      "cause_zh": "JSON 不支持十六进制写法，请写十进制。"
    },
    {
      "id": "python-literals",
      "bad": "{\"ok\": True, \"missing\": None}",
      "fixed": "{\"ok\": true, \"missing\": null}",
      "cause_en": "JSON literals are lowercase true/false/null (not Python's True/None).",
      "cause_zh": "JSON 的字面量是小写 true/false/null，不是 Python 的 True/None。"
    },
    {
      "id": "js-object-literal",
      "bad": "{name: \"YYSI\", qty: 3}",
      "fixed": "{\"name\": \"YYSI\", \"qty\": 3}",
      "cause_en": "Object keys must be double-quoted strings in JSON.",
      "cause_zh": "JSON 对象的键必须是用双引号括起来的字符串。"
    },
    {
      "id": "markdown-fence",
      "bad": "```json\n{\"ok\": true}\n```",
      "fixed": "{\"ok\": true}",
      "cause_en": "Copy from chat/LLM output often includes Markdown fences; they are not JSON.",
      "cause_zh": "从聊天/大模型输出复制的内容常带 Markdown 围栏，它们不是 JSON 的一部分。"
    },
    {
      "id": "equals-sign",
      "bad": "{\"timeout\" = 30}",
      "fixed": "{\"timeout\": 30}",
      "cause_en": "Key and value are separated by a colon in JSON, not an equals sign.",
      "cause_zh": "JSON 的键和值之间用冒号，不是等号。"
    },
    {
      "id": "nan-infinity",
      "bad": "{\"score\": NaN, \"limit\": Infinity}",
      "fixed": "{\"score\": null, \"limit\": \"not representable in JSON\"}",
      "cause_en": "NaN/Infinity are valid JavaScript but not JSON.",
      "cause_zh": "NaN/Infinity 是 JavaScript 的值，不是 JSON 的。"
    },
    {
      "id": "empty-input",
      "bad": "",
      "fixed": "{}",
      "cause_en": "Empty input is not valid JSON.",
      "cause_zh": "空输入不是有效 JSON。"
    }
  ],
  "valid_demos": {
    "big-integer-warning": "{\"order_id\": 9007199254740993, \"note\": \"above 2^53-1\"}",
    "duplicate-keys": "{\"a\": 1, \"a\": 2}",
    "nested-config": "{\n  \"service\": \"yysi\",\n  \"limits\": {\"max_files\": 20, \"max_mb\": 20},\n  \"formats\": [\"jpg\", \"png\", \"webp\"],\n  \"beta\": false,\n  \"fallback\": null\n}"
  }
}