{
  "id": "go/protobuf-json-unmarshal-unknown-field",
  "signature": "proto: (line 1:2): unknown field \"unknownField\" in jsonpb.Message",
  "signature_zh": "proto: (第1行:2): 未知字段 \"unknownField\" 在 jsonpb.Message 中",
  "regex": "proto:\\ \\(line\\ 1:2\\):\\ unknown\\ field\\ \"unknownField\"\\ in\\ jsonpb\\.Message",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The JSON data contains a field that is not defined in the protobuf message. This can happen when the JSON schema is out of sync with the proto definition.",
  "root_cause_type": "generic",
  "root_cause_zh": "JSON 数据包含 protobuf 消息中未定义的字段。这可能发生在 JSON 模式与 proto 定义不同步时。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This may hide schema mismatches and lead to data loss or misinterpretation.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Not scalable and doesn't fix the underlying schema issue.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.9,
      "how": "// Option 1: Update proto and regenerate\n// Option 2: Use jsonpb.Unmarshaler\nunmarshaler := &jsonpb.Unmarshaler{AllowUnknownFields: true}\nif err := unmarshaler.Unmarshal(strings.NewReader(jsonStr), &msg); err != nil {\n    log.Fatal(err)\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "// Use a JSON schema validator or compare fields\n// Or catch the error and log the unknown field for investigation",
      "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-11-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}