Commit Graph

384 Commits

Author SHA1 Message Date
Jon Skeet
7cc9cb407b Move test for standalone BoolValue to JsonParserTest
Also added a standalone formatter test, for confidence.
Have validated that undoing the change in 835fb947 breaks the tests
(i.e. we are still testing that the change is required).
2016-05-11 18:07:03 +01:00
Jos Hickson
835fb947cc Fixed parsing of BoolValue. 2016-05-11 15:36:02 +01:00
Jon Skeet
5b5e369b18 Merge pull request #1471 from jskeet/any-host
Allow custom type URL prefixes in Any.Pack
2016-05-06 06:29:03 +01:00
Jon Skeet
61307b86f5 Allow custom type URL prefixes in Any.Pack
(And likewise ignore the prefix in unpack.)

Fixes issue #1459.
2016-04-29 10:20:03 +01:00
Jisi Liu
12fdeb9b41 Merge branch 'master' of github.com:google/protobuf 2016-04-28 14:43:08 -07:00
Jon Skeet
c588ac42a2 Regenerate well-known types for C#
(There are documentation changes and new fields in descriptor.proto that have resulted
in changes to the serialized descriptor, but no breaking changes for C#.)
2016-04-20 17:19:42 +01:00
Jon Skeet
790f4c8e37 Use the original name in JSON formatting.
(JSON parsing already does the right thing.)
2016-04-20 03:46:02 +01:00
Jon Skeet
84ea2c7a81 Regenerate all C# code and make it compile
JSON tests fail, as we're not using OriginalNameAttribute yet.
2016-04-20 03:46:00 +01:00
Jon Skeet
75626ed79c Add C# codegen changes to enum value names (mostly C++)
Overview of changes:
- A new C#-specific command-line option, legacy_enum_values to revert to the old behavior
- When legacy_enum_values isn't specified, we strip the enum name as a prefix, and PascalCase the value name
- A new attribute within the C# code so that we can always tell the original in-proto name

Regenerating the C# code with legacy_enum_values leads to code which still compiles and works - but
there's more still to do.
2016-04-20 03:45:59 +01:00
Jon Skeet
46e088e2b6 Remove duplicate test cases.
(NCrunch noticed these.)
2016-04-01 17:18:45 +01:00
Jan Tattermusch
099ff1ea14 Merge pull request #1369 from jskeet/tools-nuspec
Introduce a new nuget package, Google.Protobuf.Tools, basically to contain protoc on multiple platforms.
2016-03-31 17:44:40 -07:00
Jon Skeet
dfd47600d1 Remove duplicate line 2016-03-31 10:46:55 +01:00
Jon Skeet
ca0461c186 Introduce a new nuget package, Google.Protobuf.Tools, basically to contain protoc on multiple platforms.
I've moved both protoc.exe and the proto files out of Google.Protobuf.
The .proto files aren't a slam-dunk, but it feels like they belong with protoc as you'd *use* them with protoc.
It's not clear to me whether we really need both an x86 and x64 version of protoc.exe, as x86 would work on 64-bit Windows anyway. Discuss :)
2016-03-31 07:12:17 +01:00
Jon Skeet
71e8dca083 Refactoring of FieldDescriptor
This makes no externally visible behavioral changes. Internally and non-behaviorally:

- We use a field (compiler-generated) to store the JsonName to avoid recomputing it repeatedly
- The documentation for JsonName is updated to reflect the meaning better
- Readonly autoprops and expression-bodied properties used where possible
2016-03-30 09:42:37 +01:00
alien
6f8dd2115b Code review fixes 2016-03-29 20:56:32 +03:00
alien
0d32ab37fa csharp: add support for the json_name option
Conflicts:
	csharp/src/Google.Protobuf/JsonFormatter.cs
2016-03-18 22:59:50 +03:00
avgweb
ad2d775e1b Replace StringBuilder with TextWriter in JsonFormatter 2016-03-06 17:50:02 -08:00
Jon Skeet
f222a9a5e6 Fix copy/paste typo in CodedInputStreamTest 2016-03-01 07:30:40 +00:00
Jon Skeet
c0cf71bec9 Implement IDisposable for CodedInputStream and CodedOutputStream
This fixes issue #679 and issue #1282.
(The .gitignore change is just around ncrunch; I can put it in a separate PR if you really want.)
2016-02-29 11:51:56 +00:00
Jon Skeet
42371463de Require VS2015 in the solution file 2016-02-22 13:04:01 +00:00
Jan Tattermusch
c003abb40d Merge pull request #1240 from jskeet/validate_group
Validate that end-group tags match their corresponding start-group tags
2016-02-18 14:38:06 -08:00
Jon Skeet
abc09f795e Merge pull request #1239 from jskeet/call_generate_protos
Generate C# code whenever descriptor.proto changes
2016-02-18 06:45:51 +00:00
Jon Skeet
0262e04dbb Add more tests around merging wrappers
This was in an attempt to fix the wrapper handling corner case, but it's really fiddly.
2016-02-15 14:17:02 +00:00
Jon Skeet
9bdc848832 Validate that end-group tags match their corresponding start-group tags
This detects:
- An end-group tag with the wrong field number (doesn't match the start-group field)
- An end-group tag with no preceding start-group tag

Fixes issue #688.
2016-02-15 11:58:01 +00:00
Jon Skeet
957e877d52 Generate C# code whenever descriptor.proto changes
This is a start to fixing issue #1212. It won't help for test protos,
conformance etc, but it will definitely be better than nothing, and
would have highlighted a change in descriptor.proto which broken C#
earlier.
2016-02-15 10:33:13 +00:00
Jan Tattermusch
2d3f79f7d6 Merge pull request #1218 from jskeet/nuspec-dependencies
nuspec dependency fixes
2016-02-11 10:38:35 -08:00
Jan Tattermusch
95c4100230 Add a link 2016-02-10 08:16:45 -08:00
Jan Tattermusch
d40e3a1623 Use checked-in key to build ReleaseSigned 2016-02-09 15:59:05 -08:00
Jan Tattermusch
82f210cbac add private key for strong name assemblies 2016-02-09 15:53:16 -08:00
Jon Skeet
f1c5754f0f nuspec dependency fixes
Explicitly don't add any dependencies for "old" platforms, to avoid unnecessary
dependencies in those cases.

Fixes issue #1203.
2016-02-08 11:25:07 +00:00
Jon Skeet
045b528d4a Generated code changes from previous commit 2016-02-04 15:02:59 +00:00
Jon Skeet
7762f163a4 Rename Preconditions to ProtoPreconditions
(Generated code changes in next commit.)
2016-02-04 14:50:43 +00:00
Jon Skeet
b6159965ec Generated code for GeneratedCodeInfo change 2016-02-04 07:08:55 +00:00
Jon Skeet
a3ea9d1203 Rename GeneratedCodeInfo to GeneratedClrTypeInfo
Recently, descriptor.proto gained a GeneratedCodeInfo message, which means the generated code conflicts with our type.
Unfortunately this affects codegen as well, although this is a part of the public API which is very unlikely to affect hand-written code.

Generated code changes in next commit.
2016-02-04 07:05:49 +00:00
Jon Skeet
0809de8e9f Clarify readme 2016-02-03 09:45:48 +00:00
Jan Tattermusch
b13874d59e Merge pull request #1158 from jskeet/nonnormalized-tostring
Ensure that FieldMask, Timestamp and Duration ToString() calls don't throw
2016-01-26 08:43:45 -08:00
Jon Skeet
3878d84662 Fix mistakes in highest-representable float64 integers 2016-01-21 10:49:57 +00:00
Jon Skeet
dd43dcca8c Ensure that FieldMask, Timestamp and Duration ToString() calls don't throw
The usage of ICustomDiagnosticMessage here is non-essential - ToDiagnosticString
doesn't actually get called by ToString() in this case, due to JsonFormatter code. It was
intended to make it clearer that it *did* have a custom format... but then arguably I should
do the same for Value, Struct, Any etc.

Moving some of the code out of JsonFormatter and into Duration/Timestamp/FieldMask likewise
feels somewhat nice, somewhat nasty... basically there are JSON-specific bits of formatting, but
also domain-specific bits of computation. <sigh>

Thoughts welcome.
2016-01-20 18:43:00 +00:00
Jan Tattermusch
8c5260b21b Merge pull request #1096 from jskeet/custom-to-string
Introduce ICustomDiagnosticMessage to allow for custom string formatting
2016-01-19 19:38:16 -08:00
Jon Skeet
030c268489 Fix broken test 2016-01-15 17:34:10 +00:00
Jon Skeet
b1ea15f7a5 Make sure that
"valueField": null

is parsed appropriately, i.e. that it remembers that the field is set.
2016-01-15 14:18:16 +00:00
Jon Skeet
8866d6a80e Reject JSON containing the same oneof field twice 2016-01-15 13:54:17 +00:00
Jon Skeet
52db5139c4 Change handling of unknown enums: we now write out the value as a number. 2016-01-15 13:45:53 +00:00
Jon Skeet
f437b67f60 Extra strictness for FieldMask conversion 2016-01-15 12:02:07 +00:00
Jon Skeet
022a9b2675 Allow the original field name (rather than camel-cased) when parsing JSON 2016-01-15 11:39:54 +00:00
Jon Skeet
1fc485928f Fixes to JSON timestamp/duration representations 2016-01-15 11:39:27 +00:00
Jon Skeet
c74676f070 Report serialization errors in conformance tests 2016-01-15 10:55:57 +00:00
Jon Skeet
888e71bdfc Prohibit null values in repeated and map fields in JSON 2016-01-15 10:55:36 +00:00
Jon Skeet
1a34ac03be Throw a better exception when invalid base64 is detected in JSON 2016-01-15 10:43:06 +00:00
Jon Skeet
730c38ad8c Support (and test) numeric enum parsing in JSON 2016-01-15 10:41:56 +00:00