You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of protobuf and what language are you using?
Protobuf version: 3
ruby gem version: 3.12.0.rc.1
Language: Ruby
What operating system (Linux, Windows, ...) and version?
MacOS 10.14.4
What runtime / compiler are you using (e.g., python version or gcc version)
Ruby 2.7
What did you do?
Assuming i have a generated Ruby class from Protobuf, called MyMessage
# raises Google::Protobuf::ParseError (expected)MyMessage.decode_json("I cannot understand this",ignore_unknown_fields: true)# returns a MyMessage.new object (expected since number is a valid JSON)MyMessage.decode_json("1",ignore_unknown_fields: true)# returns a MyMessage.new object (unexpected? this is a string so I expected it to throw)MyMessage.decode_json("1 cannot understand this",ignore_unknown_fields: true)
Would this be a known or expected behaviour? 🙇
The text was updated successfully, but these errors were encountered:
The Ruby JSON decoder may not be properly verifying that it is at end-of-file.
There is a major change to the Ruby implementation coming soon. I'll revisit this bug after that is complete, and we can see if the new JSON parser has the same issue.
I just tested your examples on #8184 and all of your examples throw errors now. This is expected since parsing a message from JSON requires a top-level object in {}.
Your second example now throws this error: Error occurred during parsing: Error parsing JSON @1:0: Expected: '{'
What version of protobuf and what language are you using?
Protobuf version: 3
ruby gem version: 3.12.0.rc.1
Language: Ruby
What operating system (Linux, Windows, ...) and version?
MacOS 10.14.4
What runtime / compiler are you using (e.g., python version or gcc version)
Ruby 2.7
What did you do?
Assuming i have a generated Ruby class from Protobuf, called MyMessage
Would this be a known or expected behaviour? 🙇
The text was updated successfully, but these errors were encountered: