# proto: JSON 中字段 "name" 重复

- **ID:** `go/protobuf-json-marshal-duplicate-field`
- **领域:** go
- **类别:** data_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

JSON 输入中同一字段出现多次，protojson 拒绝解析。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.x | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   // Validate JSON before sending; use a library that enforces uniqueness.
   ```
2. **** (85% 成功率)
   ```
   opts := protojson.UnmarshalOptions{DiscardUnknown: true}
err := opts.Unmarshal(data, msg)
   ```

## 无效尝试

- **** — Lenient parsers may not handle protobuf semantics correctly. (80% 失败率)
- **** — Manual removal is error-prone and not scalable. (70% 失败率)
