aboutsummaryrefslogtreecommitdiff
path: root/csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs
Commit message (Collapse)AuthorAgeFilesLines
* Change JSON field name formattingJon Skeet2016-11-031-6/+6
| | | | | | | | | This affects cases with leading capital letters. This breaks compatibility with previous C# releases, but fixes compatibility with other implementations. See #2278 for details.
* Bring C#'s ToPascalCase method in line with C++.Jon Skeet2016-07-271-0/+6
| | | | | (This still doesn't fix the conformance tests, but at least we're now consistent with the C++ code.)
* Expose JsonFormatter.WriteValue.Jon Skeet2016-06-231-0/+47
| | | | | This isn't useful to most users, but can be handy in advanced use cases, as requested in #1465.
* Move test for standalone BoolValue to JsonParserTestJon Skeet2016-05-111-0/+16
| | | | | | 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).
* Allow custom type URL prefixes in Any.PackJon Skeet2016-04-291-0/+9
| | | | | | (And likewise ignore the prefix in unpack.) Fixes issue #1459.
* Regenerate all C# code and make it compileJon Skeet2016-04-201-5/+5
| | | | JSON tests fail, as we're not using OriginalNameAttribute yet.
* Remove duplicate test cases.Jon Skeet2016-04-011-1/+0
| | | | (NCrunch noticed these.)
* Ensure that FieldMask, Timestamp and Duration ToString() calls don't throwJon Skeet2016-01-201-2/+15
| | | | | | | | | | | | | 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.
* Fix broken testJon Skeet2016-01-151-1/+1
|
* Change handling of unknown enums: we now write out the value as a number.Jon Skeet2016-01-151-11/+8
|
* Extra strictness for FieldMask conversionJon Skeet2016-01-151-0/+10
|
* Fixes to JSON timestamp/duration representationsJon Skeet2016-01-151-3/+25
|
* Prohibit null values in map fieldsJon Skeet2016-01-111-7/+0
| | | | | On deserialization, missing values for message types are replaced with a "default" message.
* Ensure all formatted well-known-type values are valid JSONJon Skeet2016-01-061-17/+24
| | | | | | | This involves quoting timestamp/duration/field-mask values, even when they're not in fields. It's better for consistency. Fixes issue #1097.
* JSON formatting for Any.Jon Skeet2015-12-021-0/+42
|
* Implement JSON parsing in C#.Jon Skeet2015-11-031-6/+21
| | | | | | | | | | This includes all the well-known types except Any. Some aspects are likely to require further work when the details of the JSON parsing expectations are hammered out in more detail. Some of these have "ignored" tests already. Note that the choice *not* to use Json.NET was made for two reasons: - Going from 0 dependencies to 1 dependency is a big hit, and there's not much benefit here - Json.NET parses more leniently than we'd want; accommodating that would be nearly as much work as writing the tokenizer This only really affects the JsonTokenizer, which could be replaced by Json.NET. The JsonParser code would be about the same length with Json.NET... but I wouldn't be as confident in it.
* remove duplicate test caseJan Tattermusch2015-08-141-1/+0
|
* JSON formatting for FieldMaskJon Skeet2015-08-031-0/+18
|
* Initial pass at formatting Struct as JSON.Jon Skeet2015-08-031-0/+17
| | | | This seems remarkably little code, but it appears to work. I can add tests for invalid structs at some point, once the general approach is approved.
* Format JSON for Duration and Timestamp.Jon Skeet2015-08-031-0/+61
| | | | This is taking an approach of putting all the logic in JsonFormatter. That's helpful in terms of concealing the details of whether or not to wrap the value in quotes, but it does lack flexibility. I don't *think* we want to allow user-defined formatting of messages, so that much shouldn't be a problem.
* Simplify the JSON tests for readabilityJon Skeet2015-07-311-60/+71
| | | | Use ' instead of " in the expected JSON, then replace it before asserting.
* Fix JSON formatting to always emit fields in field order, including oneofsJon Skeet2015-07-311-0/+25
|
* First part of JSON formatting for well-known types. I think we need a ↵Jon Skeet2015-07-201-0/+27
| | | | reflection API rethink before doing the rest.
* First pass at the big rename from ProtocolBuffers to Google.Protobuf.Jon Skeet2015-07-171-0/+261
We'll see what I've missed when CI fails...