From 7beb116549cf37f97e3a35d4a38598116f98ce2e Mon Sep 17 00:00:00 2001 From: Jon Skeet Date: Tue, 2 Aug 2022 14:57:29 +0100 Subject: [PATCH] Clarify C# MessageParser and JSON parsing behavior Addresses #8316 as far as we want to. --- csharp/src/Google.Protobuf/MessageParser.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/csharp/src/Google.Protobuf/MessageParser.cs b/csharp/src/Google.Protobuf/MessageParser.cs index 66907d46fa..57102920ef 100644 --- a/csharp/src/Google.Protobuf/MessageParser.cs +++ b/csharp/src/Google.Protobuf/MessageParser.cs @@ -171,6 +171,10 @@ namespace Google.Protobuf /// /// Parses a message from the given JSON. /// + /// This method always uses the default JSON parser; it is not affected by . + /// To ignore unknown fields when parsing JSON, create a using a + /// with set to true and call directly. + /// /// The JSON to parse. /// The parsed message. /// The JSON does not comply with RFC 7159 @@ -203,6 +207,9 @@ namespace Google.Protobuf /// /// Creates a new message parser which optionally discards unknown fields when parsing. /// + /// Note that this does not affect the behavior of + /// at all. To ignore unknown fields when parsing JSON, create a using a + /// with set to true and call directly. /// Whether or not to discard unknown fields when parsing. /// A newly configured message parser. public MessageParser WithDiscardUnknownFields(bool discardUnknownFields) =>