[protobuf] Re: Issue 229 in protobuf: TextFormat should have option to silently ignore unknown fields

2014-02-21 Thread protobuf


Comment #2 on issue 229 by k...@spotify.com: TextFormat should have option  
to silently ignore unknown fields

http://code.google.com/p/protobuf/issues/detail?id=229

We use the text format for fixture data in our test cases (we don't want to  
have binary data in our repository), and we occasionally regenerate these  
files from live data. If the live schema has been updated (but we don't  
really care) it would be nice if the text format ignored the unknown fields.


--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
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/groups/opt_out.


[protobuf] Re: Issue 229 in protobuf: TextFormat should have option to silently ignore unknown fields

2010-10-26 Thread protobuf

Updates:
Status: WorkingAsIntended

Comment #1 on issue 229 by ken...@google.com: TextFormat should have option  
to silently ignore unknown fields

http://code.google.com/p/protobuf/issues/detail?id=229

This has come up before.  Copied from a previous answer:

Text format is designed for communicating with people whereas binary format  
is for communicating with machines. People make mistakes, like spelling  
errors. These mistakes should be caught, not silently ignored. Therefore,  
text format is NOT designed with the same forward- and  
backward-compatibility properties as the binary format, and should not be  
used when such compatibility is desired.


If you find yourself wanting to ignore unknown fields when parsing a  
text-format message, most likely you should be using binary format instead.  
One common use case of this is config files that are distributed to  
production machines where some of those machines may be older and not know  
about newly-added fields. In this case, what you should do is distribute  
these configs as binary messages. You can still edit them in text format,  
but then you should invoke protoc with --encode to produce a binary file  
for distribution. Since you give protoc the newest version of the .proto  
file, it will not need to ignore any fields. Remember that you can always  
use protoc --decode to convert back to text.


--
You received this message because you are subscribed to the Google Groups Protocol 
Buffers group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.