Skip to content

Commit

Permalink
Ignore unknown fields (#12)
Browse files Browse the repository at this point in the history
* Ignore unknown fields

* fix
  • Loading branch information
dorner authored Jul 30, 2024
1 parent fa516a2 commit 63a00b3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## UNRELEASED

# 0.1.17 - 2024-07-30
- Ignore unknown fields in JSON decoding

# 0.1.16 - 2024-07-09
- Support requests in camel case

Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
grpc-rest (0.1.16)
grpc-rest (0.1.17)
grpc
rails (>= 6.0)

Expand Down
2 changes: 1 addition & 1 deletion lib/grpc_rest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def map_proto_type(proto, params)

def init_request(request_class, params)
map_proto_type(request_class.descriptor, params)
request_class.decode_json(JSON.generate(params))
request_class.decode_json(JSON.generate(params), ignore_unknown_fields: true)
end

def assign_params(request, param_hash, body_string, params)
Expand Down
2 changes: 1 addition & 1 deletion lib/grpc_rest/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module GrpcRest
VERSION = '0.1.16'
VERSION = '0.1.17'
end

0 comments on commit 63a00b3

Please sign in to comment.