# proto: (line 1:2): unknown field "unknown_field" in pb.YourMessage

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

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

## Version Compatibility

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

## Workarounds

1. **** (95% success)
   ```
   import "google.golang.org/protobuf/encoding/protojson"
opts := protojson.UnmarshalOptions{DiscardUnknown: true}
err := opts.Unmarshal(data, msg)
   ```
2. **** (90% success)
   ```
   // Add the field to your .proto file and regenerate.
// message YourMessage { string unknown_field = 1; }
   ```

## Dead Ends

- **** — This is a temporary fix; the field may reappear or be required by other clients. (60% fail)
- **** — encoding/json does not understand protobuf field names and will produce incorrect results. (80% fail)
