# proto: (line 1:2): unknown field "unknownField" in jsonpb.Message

- **ID:** `go/protobuf-json-unmarshal-unknown-field`
- **Domain:** go
- **Category:** data_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## 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.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.x | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   // Option 1: Update proto and regenerate
// Option 2: Use jsonpb.Unmarshaler
unmarshaler := &jsonpb.Unmarshaler{AllowUnknownFields: true}
if err := unmarshaler.Unmarshal(strings.NewReader(jsonStr), &msg); err != nil {
    log.Fatal(err)
}
   ```
2. **** (85% success)
   ```
   // Use a JSON schema validator or compare fields
// Or catch the error and log the unknown field for investigation
   ```

## Dead Ends

- **** — This may hide schema mismatches and lead to data loss or misinterpretation. (60% fail)
- **** — Not scalable and doesn't fix the underlying schema issue. (80% fail)
