C# JsonFormatter does not output proto2 extension information
What version of protobuf and what language are you using? Version: v3.26.1 Language: C#
What operating system (Linux, Windows, ...) and version? N/A
What runtime / compiler are you using (e.g., python version or gcc version) N/A
What did you do?
JsonFormatter does not output proto2 extension information.
[Test]
public void FormatExtensionFields()
{
var formatter = JsonFormatter.Default;
var message = new TestProtos.Proto2.TestAllExtensions();
message.SetExtension(TestProtos.Proto2.UnittestExtensions.OptionalBoolExtension, true);
message.SetExtension(
TestProtos.Proto2.UnittestExtensions.OptionalNestedMessageExtension,
new TestProtos.Proto2.TestAllTypes.Types.NestedMessage
{
Bb = 123
});
AssertJson("{ 'optionalBoolExtension': true, 'nestedMessage': { 'bb': 123 } }", formatter.Format(message));
}
Result:
FormatExtensionFields
Source: JsonFormatterTest.cs line 55
Duration: 85 ms
Message:
Expected string length 65 but was 3. Strings differ at index 2.
Expected: "{ "optionalBoolExtension": true, "nestedMessage": { "bb": 123..."
But was: "{ }"
-------------^
Stack Trace:
JsonFormatterTest.AssertJson(String expectedJsonWithApostrophes, String actualJson) line 640
JsonFormatterTest.FormatExtensionFields() line 68
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago.
Updated code as the package/namespace for the extensions changed. The behavior is the same, though, this still doesn't work.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago.
As far as I'm aware this has not been fixed.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.
As far as I'm aware this has not been fixed.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.
As far as I'm aware this has not been fixed.
We triage inactive PRs and issues in order to make it easier to find active work. If this issue should remain active or becomes active again, please add a comment.
This issue is labeled inactive because the last activity was over 90 days ago. This issue will be closed and archived after 14 additional days without activity.