{
  "id": "go/proto-json-unknown-field",
  "signature": "proto: (line 1:15): unknown field \"userName\"",
  "signature_zh": "proto: （第 1 行第 15 列）：未知字段 \"userName\"",
  "regex": "proto:\\ \\(line\\ 1:15\\):\\ unknown\\ field\\ \"userName\"",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "protojson.Unmarshal encountered a JSON key that does not match any field in the message. By default protojson rejects unknown fields and is case-sensitive on the proto field names (camelCase or snake_case accepted).",
  "root_cause_type": "generic",
  "root_cause_zh": "protojson.Unmarshal 遇到与消息中任何字段都不匹配的 JSON 键。默认情况下 protojson 拒绝未知字段，且对 proto 字段名大小写敏感（接受 camelCase 或 snake_case）。",
  "versions": [
    {
      "version": "google.golang.org/protobuf v1.30+",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Field renames change the wire contract and require regenerating all clients; it treats a symptom, not the schema mismatch.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "protojson returns an error and leaves the message partially populated or empty; downstream reads wrong data.",
      "fail_rate": 0.85,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "opts := protojson.UnmarshalOptions{DiscardUnknown: true}\nerr := opts.Unmarshal(data, msg)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "// user.proto\nstring user_name = 1 [json_name = \"userName\"];",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-14",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}