{
  "id": "go/protobuf-json-marshal-unknown-field",
  "signature": "proto: (line 1:2): unknown field \"unknown_field\" in pb.YourMessage",
  "signature_zh": "proto: (第 1 行:第 2 列): 在 pb.YourMessage 中未知字段 \"unknown_field\"",
  "regex": "proto:\\ \\(line\\ 1:2\\):\\ unknown\\ field\\ \"unknown_field\"\\ in\\ pb\\.YourMessage",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The JSON input contains a field that is not defined in the protobuf message, and the unmarshaler is configured to reject unknown fields.",
  "root_cause_type": "generic",
  "root_cause_zh": "JSON 输入包含 protobuf 消息中未定义的字段，且解组器配置为拒绝未知字段。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "This is a temporary fix; the field may reappear or be required by other clients.",
      "fail_rate": 0.6,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "encoding/json does not understand protobuf field names and will produce incorrect results.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "import \"google.golang.org/protobuf/encoding/protojson\"\nopts := protojson.UnmarshalOptions{DiscardUnknown: true}\nerr := opts.Unmarshal(data, msg)",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "// Add the field to your .proto file and regenerate.\n// message YourMessage { string unknown_field = 1; }",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-08-22",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}