arthurnn / twirp-ruby

Twirp services in Ruby
Apache License 2.0
155 stars 60 forks source link

Ignore unknown JSON fields when decoding requests. #60

Closed alusco-scratch closed 4 years ago

alusco-scratch commented 4 years ago

In version 3.7 of protobufs the option to ignore unknown JSON fields was added. Setting this flag to true makes it so JSON encoded requests can be mostly backwards compatible just like existing protobuf encoding.

This fixes #59.

alusco-scratch commented 4 years ago

Ya if we did want to do that, we could add a JSON_STRICT and did the content type thing I was talking about of 'application/json; strict=true'

alusco-scratch commented 4 years ago

I sent a PR for this https://github.com/twitchtv/twirp-ruby/pull/61 @marioizquierdo We can decide not to do it just wanted to throw it out there. I kind of like it to be honest.