Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
protobuf
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
protobuf
Commits
cca2d44e
Commit
cca2d44e
authored
May 11, 2016
by
Jon Skeet
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1517 from jhickson/boolvalue
Fix C# Json parsing of well-known type Boolvalue
parents
a1938b2a
835fb947
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
WrappersTest.cs
...p/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs
+7
-0
JsonParser.cs
csharp/src/Google.Protobuf/JsonParser.cs
+2
-1
No files found.
csharp/src/Google.Protobuf.Test/WellKnownTypes/WrappersTest.cs
View file @
cca2d44e
...
@@ -417,5 +417,12 @@ namespace Google.Protobuf.WellKnownTypes
...
@@ -417,5 +417,12 @@ namespace Google.Protobuf.WellKnownTypes
TestWellKnownTypes
.
Descriptor
.
Fields
[
TestWellKnownTypes
.
StringFieldFieldNumber
].
Accessor
.
Clear
(
message
);
TestWellKnownTypes
.
Descriptor
.
Fields
[
TestWellKnownTypes
.
StringFieldFieldNumber
].
Accessor
.
Clear
(
message
);
Assert
.
IsNull
(
message
.
StringField
);
Assert
.
IsNull
(
message
.
StringField
);
}
}
[
Test
]
public
void
GivenBoolValueWhenPerformingRoundTripEncodingViaJsonThenShouldNotExpectObjectAtTopLevel
()
{
var
value
=
new
BoolValue
{
Value
=
true
};
Assert
.
AreEqual
(
value
,
JsonParser
.
Default
.
Parse
<
BoolValue
>(
JsonFormatter
.
Default
.
Format
(
value
)));
}
}
}
}
}
csharp/src/Google.Protobuf/JsonParser.cs
View file @
cca2d44e
...
@@ -86,7 +86,8 @@ namespace Google.Protobuf
...
@@ -86,7 +86,8 @@ namespace Google.Protobuf
{
FloatValue
.
Descriptor
.
FullName
,
MergeWrapperField
},
{
FloatValue
.
Descriptor
.
FullName
,
MergeWrapperField
},
{
DoubleValue
.
Descriptor
.
FullName
,
MergeWrapperField
},
{
DoubleValue
.
Descriptor
.
FullName
,
MergeWrapperField
},
{
BytesValue
.
Descriptor
.
FullName
,
MergeWrapperField
},
{
BytesValue
.
Descriptor
.
FullName
,
MergeWrapperField
},
{
StringValue
.
Descriptor
.
FullName
,
MergeWrapperField
}
{
StringValue
.
Descriptor
.
FullName
,
MergeWrapperField
},
{
BoolValue
.
Descriptor
.
FullName
,
MergeWrapperField
}
};
};
// Convenience method to avoid having to repeat the same code multiple times in the above
// Convenience method to avoid having to repeat the same code multiple times in the above
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment