Skip to content

Commit

Permalink
🔧 Discard unknown fields when unmarshaling state (#44)
Browse files Browse the repository at this point in the history
  • Loading branch information
rogchap authored Jan 8, 2021
1 parent 2818378 commit ec48d27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
- A canceled client stream blocks further requests
- Output syntax highlighting on Windows
- State miss match with descriptor causes `unknown field` error

## [v0.3.3] - 2020-12-13

Expand Down
2 changes: 1 addition & 1 deletion internal/app/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,7 @@ func (a *api) Send(method string, rawJSON []byte, rawHeaders interface{}) (rerr
}

req := dynamicpb.NewMessage(md.Input())
if err := protojson.Unmarshal(rawJSON, req); err != nil {
if err := (protojson.UnmarshalOptions{DiscardUnknown: true}).Unmarshal(rawJSON, req); err != nil {
return err
}

Expand Down

0 comments on commit ec48d27

Please sign in to comment.