# proto: (line 1:15): unknown field "userName"

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

## Root Cause

protojson.Unmarshal encountered a JSON key that does not match any field in the message. By default protojson rejects unknown fields and is case-sensitive on the proto field names (camelCase or snake_case accepted).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| google.golang.org/protobuf v1.30+ | active | — | — |

## Workarounds

1. **** (90% success)
   ```
   opts := protojson.UnmarshalOptions{DiscardUnknown: true}
err := opts.Unmarshal(data, msg)
   ```
2. **** (85% success)
   ```
   // user.proto
string user_name = 1 [json_name = "userName"];
   ```

## Dead Ends

- **** — Field renames change the wire contract and require regenerating all clients; it treats a symptom, not the schema mismatch. (60% fail)
- **** — protojson returns an error and leaves the message partially populated or empty; downstream reads wrong data. (85% fail)
