JsonParserParseJson(String, JsonNodeUnexpectedDuplicateSiblingReaction) Method
Parse the given JSON.
Namespace: MichaelBrooks.UK.JsonAssembly: JsonDOM (in JsonDOM.dll) Version: 1.0.7
public static JsonNode ParseJson(
string jsonDocument,
JsonNodeUnexpectedDuplicateSiblingReaction unexpectedDuplicateSiblingReaction
)
- jsonDocument String
- The JSON to be parsed.
- unexpectedDuplicateSiblingReaction JsonNodeUnexpectedDuplicateSiblingReaction
- How the JsonNode.Item(String) operators
should react when attempting to retrieve the member of a JSON object by name when multiple members
have that same name.
JsonNodeA parse tree or document object model (DOM), populated with
JsonNode objects.
String businessDataFilePath = Directory.GetCurrentDirectory() + @"\Example1.json";
String json = File.ReadAllText(businessDataFilePath); // Throws FileNotFoundException if file does not exist
JsonNode jsonDOM = JsonParser.ParseJson(json, JsonNode.UnexpectedDuplicateSiblingReaction.First);
| ArgumentException | Thrown if content of jsonDocument is not valid JSON. |