Instances of this class are thread-safe, with no mutable state.
This is a simple start to get JSON parsing working. As it's reflection-based,
it's not as quick as baking calls into generated messages - but is a simpler implementation.
(This code is generally not heavily optimized.)
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003e\u003ccode\u003eJsonParser\u003c/code\u003e is a reflection-based converter for transforming JSON data into messages, providing a straightforward way to parse JSON.\u003c/p\u003e\n"],["\u003cp\u003eThis class is thread-safe, featuring no mutable state, and while simpler, it may not be as optimized as methods with baked-in calls.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eJsonParser\u003c/code\u003e can be created with custom settings using the \u003ccode\u003eJsonParser(Settings)\u003c/code\u003e constructor or the default settings via the \u003ccode\u003eDefault\u003c/code\u003e property.\u003c/p\u003e\n"],["\u003cp\u003eIt provides methods like \u003ccode\u003eParse\u003c/code\u003e to convert JSON from a \u003ccode\u003eTextReader\u003c/code\u003e or a string into an \u003ccode\u003eIMessage\u003c/code\u003e or a specific message type \u003ccode\u003eT\u003c/code\u003e, and it throws exceptions for invalid JSON or protocol buffer formats.\u003c/p\u003e\n"],["\u003cp\u003eThe latest version available is \u003ccode\u003e3.27.1\u003c/code\u003e, followed by \u003ccode\u003e3.23.0\u003c/code\u003e and then \u003ccode\u003e3.15.8\u003c/code\u003e.\u003c/p\u003e\n"]]],[],null,["# Class JsonParser (3.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [3.27.1 (latest)](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.JsonParser)\n- [3.23.0](/dotnet/docs/reference/Google.Protobuf/3.23.0/Google.Protobuf.JsonParser)\n- [3.15.8](/dotnet/docs/reference/Google.Protobuf/3.15.8/Google.Protobuf.JsonParser) \n\n public sealed class JsonParser\n\nReflection-based converter from JSON to messages. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e JsonParser \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Google.Protobuf](/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf)\n\nAssembly\n--------\n\nGoogle.Protobuf.dll\n\nRemarks\n-------\n\n\nInstances of this class are thread-safe, with no mutable state.\n\n\nThis is a simple start to get JSON parsing working. As it's reflection-based,\nit's not as quick as baking calls into generated messages - but is a simpler implementation.\n(This code is generally not heavily optimized.)\n\nConstructors\n------------\n\n### JsonParser(Settings)\n\n public JsonParser(JsonParser.Settings settings)\n\nCreates a new formatted with the given settings.\n\nProperties\n----------\n\n### Default\n\n public static JsonParser Default { get; }\n\nReturns a formatter using the default settings.\n\nMethods\n-------\n\n### Parse(TextReader, MessageDescriptor)\n\n public IMessage Parse(TextReader jsonReader, MessageDescriptor descriptor)\n\nParses JSON read from `jsonReader` into a new message.\n\n### Parse(string, MessageDescriptor)\n\n public IMessage Parse(string json, MessageDescriptor descriptor)\n\nParses `json` into a new message.\n\n### Parse\\\u003cT\\\u003e(TextReader)\n\n public T Parse\u003cT\u003e(TextReader jsonReader) where T : IMessage, new()\n\nParses JSON read from `jsonReader` into a new message.\n\n### Parse\\\u003cT\\\u003e(string)\n\n public T Parse\u003cT\u003e(string json) where T : IMessage, new()\n\nParses `json` into a new message."]]