Re: [protobuf] JsonToBinaryString does not seem to complain about mistyped fields?

2015-11-11 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Nov 12, 2015 at 1:12 AM, Abhishek Parmar 
wrote:

> On Wed, Nov 11, 2015 at 5:02 PM, Feng Xiao  wrote:
>
>>
>>
>> On Thu, Nov 12, 2015 at 12:53 AM, Abhishek Parmar 
>> wrote:
>>
>>> On Wed, Nov 11, 2015 at 4:46 PM, Feng Xiao  wrote:
>>>


 On Tue, Nov 10, 2015 at 7:04 PM, Abhishek Parmar >>> > wrote:

> I am using v3.0.0-beta-1
>
> Based on a quick read of the code I thought 
> google/protobuf/util/internal/protostream_objectwriter.cc
> was not doing error checks in method
> ProtoStreamObjectWriter::AnyWriter::RenderDataPiece
>
> There was a TODO to make attention to status which seem to have been
> fixed in v3.0.0-beta-1-bzl-fix. I tried that and it seems no better.
>
> So perhaps there is something else that I am missing.  FWIW my code is
> closely modeled after json_util_test.cc
>
> Any help will be greatly appreciated.
>
 By mistyped fields do you mean the Any type url is incorrect? The JSON
 conversion code should report an error for that. If it's not, could you
 file an issue on our github site?

>>>
>>> I mean that if a fields for example is of type int32 and the json
>>> contains a string, it silently drops the field. I amanaged to debug a bit
>>> more and seems like this is by design as the STRING type DataPiece gets
>>> safely converted to a number?
>>>
>>> But I saw similar behavior for even nested messages. The parser just
>>> silently drops fields that do not match the type in the protobuffer. If
>>> this is intentional, then perhaps we should have a strict mode.  Let me
>>> know what you think.
>>>
>> Yeah, the parser is currently more lenient then it should be. That's a
>> known issue and we are working on fixing them. The final release of v3.0.0
>> will include a set of conformance tests to ensure all JSON implementations
>> are conforming to the same spec and the cases you mentioned here will all
>> be covered by that (and for these cases the parser should return an parsing
>> error rather than dropping the fields).
>>
>
> Thanks , thats good to know. Any ides of the timeframe for this release?
>
We will have another beta release at the end of this quarter though and
that should address most of the JSON issues (with a more detailed JSON spec
published).


> And is there any way I can help push this forward?
>
Could you help file an issue on our github site with what you discovered?
We are still discussing some of the cases and  try to determine what the
right default behavior should be (e.g., should the JSON parser error out if
a field is unknown or it should just ignore it) and some inputs from
external users could help us make an informed decision.


>
>
>>
>>
>>>
>>>


>
> Thanks
> Abhishek
>
> --
> You received this message because you are subscribed to the Google
> Groups "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>


>>>
>>>
>>> --
>>> -Abhishek
>>>
>>>
>>
>
>
> --
> -Abhishek
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] JsonToBinaryString does not seem to complain about mistyped fields?

2015-11-11 Thread Abhishek Parmar
On Wed, Nov 11, 2015 at 5:02 PM, Feng Xiao  wrote:

>
>
> On Thu, Nov 12, 2015 at 12:53 AM, Abhishek Parmar 
> wrote:
>
>> On Wed, Nov 11, 2015 at 4:46 PM, Feng Xiao  wrote:
>>
>>>
>>>
>>> On Tue, Nov 10, 2015 at 7:04 PM, Abhishek Parmar 
>>> wrote:
>>>
 I am using v3.0.0-beta-1

 Based on a quick read of the code I thought 
 google/protobuf/util/internal/protostream_objectwriter.cc
 was not doing error checks in method
 ProtoStreamObjectWriter::AnyWriter::RenderDataPiece

 There was a TODO to make attention to status which seem to have been
 fixed in v3.0.0-beta-1-bzl-fix. I tried that and it seems no better.

 So perhaps there is something else that I am missing.  FWIW my code is
 closely modeled after json_util_test.cc

 Any help will be greatly appreciated.

>>> By mistyped fields do you mean the Any type url is incorrect? The JSON
>>> conversion code should report an error for that. If it's not, could you
>>> file an issue on our github site?
>>>
>>
>> I mean that if a fields for example is of type int32 and the json
>> contains a string, it silently drops the field. I amanaged to debug a bit
>> more and seems like this is by design as the STRING type DataPiece gets
>> safely converted to a number?
>>
>> But I saw similar behavior for even nested messages. The parser just
>> silently drops fields that do not match the type in the protobuffer. If
>> this is intentional, then perhaps we should have a strict mode.  Let me
>> know what you think.
>>
> Yeah, the parser is currently more lenient then it should be. That's a
> known issue and we are working on fixing them. The final release of v3.0.0
> will include a set of conformance tests to ensure all JSON implementations
> are conforming to the same spec and the cases you mentioned here will all
> be covered by that (and for these cases the parser should return an parsing
> error rather than dropping the fields).
>

Thanks , thats good to know. Any ides of the timeframe for this release?
And is there any way I can help push this forward?


>
>
>>
>>
>>>
>>>

 Thanks
 Abhishek

 --
 You received this message because you are subscribed to the Google
 Groups "Protocol Buffers" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to protobuf+unsubscr...@googlegroups.com.
 To post to this group, send email to protobuf@googlegroups.com.
 Visit this group at http://groups.google.com/group/protobuf.
 For more options, visit https://groups.google.com/d/optout.

>>>
>>>
>>
>>
>> --
>> -Abhishek
>>
>>
>


-- 
-Abhishek

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] JsonToBinaryString does not seem to complain about mistyped fields?

2015-11-11 Thread 'Feng Xiao' via Protocol Buffers
On Thu, Nov 12, 2015 at 12:53 AM, Abhishek Parmar 
wrote:

> On Wed, Nov 11, 2015 at 4:46 PM, Feng Xiao  wrote:
>
>>
>>
>> On Tue, Nov 10, 2015 at 7:04 PM, Abhishek Parmar 
>> wrote:
>>
>>> I am using v3.0.0-beta-1
>>>
>>> Based on a quick read of the code I thought 
>>> google/protobuf/util/internal/protostream_objectwriter.cc
>>> was not doing error checks in method
>>> ProtoStreamObjectWriter::AnyWriter::RenderDataPiece
>>>
>>> There was a TODO to make attention to status which seem to have been
>>> fixed in v3.0.0-beta-1-bzl-fix. I tried that and it seems no better.
>>>
>>> So perhaps there is something else that I am missing.  FWIW my code is
>>> closely modeled after json_util_test.cc
>>>
>>> Any help will be greatly appreciated.
>>>
>> By mistyped fields do you mean the Any type url is incorrect? The JSON
>> conversion code should report an error for that. If it's not, could you
>> file an issue on our github site?
>>
>
> I mean that if a fields for example is of type int32 and the json contains
> a string, it silently drops the field. I amanaged to debug a bit more and
> seems like this is by design as the STRING type DataPiece gets safely
> converted to a number?
>
> But I saw similar behavior for even nested messages. The parser just
> silently drops fields that do not match the type in the protobuffer. If
> this is intentional, then perhaps we should have a strict mode.  Let me
> know what you think.
>
Yeah, the parser is currently more lenient then it should be. That's a
known issue and we are working on fixing them. The final release of v3.0.0
will include a set of conformance tests to ensure all JSON implementations
are conforming to the same spec and the cases you mentioned here will all
be covered by that (and for these cases the parser should return an parsing
error rather than dropping the fields).


>
>
>>
>>
>>>
>>> Thanks
>>> Abhishek
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Protocol Buffers" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to protobuf+unsubscr...@googlegroups.com.
>>> To post to this group, send email to protobuf@googlegroups.com.
>>> Visit this group at http://groups.google.com/group/protobuf.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>>
>
>
> --
> -Abhishek
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] JsonToBinaryString does not seem to complain about mistyped fields?

2015-11-11 Thread Abhishek Parmar
On Wed, Nov 11, 2015 at 4:46 PM, Feng Xiao  wrote:

>
>
> On Tue, Nov 10, 2015 at 7:04 PM, Abhishek Parmar 
> wrote:
>
>> I am using v3.0.0-beta-1
>>
>> Based on a quick read of the code I thought 
>> google/protobuf/util/internal/protostream_objectwriter.cc
>> was not doing error checks in method
>> ProtoStreamObjectWriter::AnyWriter::RenderDataPiece
>>
>> There was a TODO to make attention to status which seem to have been
>> fixed in v3.0.0-beta-1-bzl-fix. I tried that and it seems no better.
>>
>> So perhaps there is something else that I am missing.  FWIW my code is
>> closely modeled after json_util_test.cc
>>
>> Any help will be greatly appreciated.
>>
> By mistyped fields do you mean the Any type url is incorrect? The JSON
> conversion code should report an error for that. If it's not, could you
> file an issue on our github site?
>

I mean that if a fields for example is of type int32 and the json contains
a string, it silently drops the field. I amanaged to debug a bit more and
seems like this is by design as the STRING type DataPiece gets safely
converted to a number?

But I saw similar behavior for even nested messages. The parser just
silently drops fields that do not match the type in the protobuffer. If
this is intentional, then perhaps we should have a strict mode.  Let me
know what you think.


>
>
>>
>> Thanks
>> Abhishek
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Protocol Buffers" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to protobuf+unsubscr...@googlegroups.com.
>> To post to this group, send email to protobuf@googlegroups.com.
>> Visit this group at http://groups.google.com/group/protobuf.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>


-- 
-Abhishek

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


Re: [protobuf] JsonToBinaryString does not seem to complain about mistyped fields?

2015-11-11 Thread 'Feng Xiao' via Protocol Buffers
On Tue, Nov 10, 2015 at 7:04 PM, Abhishek Parmar 
wrote:

> I am using v3.0.0-beta-1
>
> Based on a quick read of the code I thought 
> google/protobuf/util/internal/protostream_objectwriter.cc
> was not doing error checks in method
> ProtoStreamObjectWriter::AnyWriter::RenderDataPiece
>
> There was a TODO to make attention to status which seem to have been fixed
> in v3.0.0-beta-1-bzl-fix. I tried that and it seems no better.
>
> So perhaps there is something else that I am missing.  FWIW my code is
> closely modeled after json_util_test.cc
>
> Any help will be greatly appreciated.
>
By mistyped fields do you mean the Any type url is incorrect? The JSON
conversion code should report an error for that. If it's not, could you
file an issue on our github site?


>
> Thanks
> Abhishek
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.


[protobuf] JsonToBinaryString does not seem to complain about mistyped fields?

2015-11-11 Thread Abhishek Parmar
I am using v3.0.0-beta-1

Based on a quick read of the code I thought 
google/protobuf/util/internal/protostream_objectwriter.cc 
was not doing error checks in method 
ProtoStreamObjectWriter::AnyWriter::RenderDataPiece

There was a TODO to make attention to status which seem to have been fixed 
in v3.0.0-beta-1-bzl-fix. I tried that and it seems no better.

So perhaps there is something else that I am missing.  FWIW my code is 
closely modeled after json_util_test.cc

Any help will be greatly appreciated.

Thanks
Abhishek

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.