From 63a00b35217bd541d3ae272935bc98d98043c17a Mon Sep 17 00:00:00 2001 From: Daniel Orner Date: Tue, 30 Jul 2024 14:35:58 -0400 Subject: [PATCH] Ignore unknown fields (#12) * Ignore unknown fields * fix --- CHANGELOG | 3 +++ Gemfile.lock | 2 +- lib/grpc_rest.rb | 2 +- lib/grpc_rest/version.rb | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 20b5a46..a0b2e4a 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 647fa19..26a5b99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - grpc-rest (0.1.16) + grpc-rest (0.1.17) grpc rails (>= 6.0) diff --git a/lib/grpc_rest.rb b/lib/grpc_rest.rb index 6cc97c1..503ebd6 100644 --- a/lib/grpc_rest.rb +++ b/lib/grpc_rest.rb @@ -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) diff --git a/lib/grpc_rest/version.rb b/lib/grpc_rest/version.rb index f4ead73..1de6896 100644 --- a/lib/grpc_rest/version.rb +++ b/lib/grpc_rest/version.rb @@ -1,3 +1,3 @@ module GrpcRest - VERSION = '0.1.16' + VERSION = '0.1.17' end