je5real / protobuf-net

Automatically exported from code.google.com/p/protobuf-net
Other
0 stars 0 forks source link

GetSchema() incorrectly adds default value for decimal types. #330

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Please include an e-mail address if this might need a dialogue!
==============

What steps will reproduce the problem?
1. Create a class with a decimal property.
2. Create a .proto file for this class using GetSchema.
3. Run Protoc on the .proto file (make sure that bcl.proto is also in the same 
dir).

What is the expected output? What do you see instead?

I see the following generated:

message Cat {
   optional bcl.DateTime Dob = 1;
   optional bcl.Decimal Weight = 2 [default = 0];
}

This is invalid syntax for a .proto file. It should look like this:

message Cat {
   optional bcl.DateTime Dob = 1;
   optional bcl.Decimal Weight = 2;
}

What version of the product are you using? On what operating system?
A build based on r591

Please provide any additional information below.

There is also a minor issue with the import statement for bcl.proto in the 
.proto file, it is missing the semicolon.

Original issue reported on code.google.com by Franches...@gmail.com on 18 Oct 2012 at 3:58