Skip to content

Latest commit

 

History

History
48 lines (30 loc) · 1.27 KB

README.md

File metadata and controls

48 lines (30 loc) · 1.27 KB

grownith

Fork JmesPath.Net for unity3D

Add

    "com.devlab.jmespath": "https://github.com/grownith/JmesPath.Net/",

To manifest.json

JmesPath.Net

A fully compliant implementation of JMESPATH for .Net Core.

Build status

Getting started

Using the parser

JmesPath.Net uses Newtonsoft.Json to handle JSON and comes with a simple to use parser:

using DevLab.JmesPath;

const string input = @"{ \"foo\": \"bar\" }";
const string expression = "foo";

var jmes = new JmesPath();
var result = jmes.Transform(input, expression);

The JmesPath.Transform method accepts and produces well formed JSON constructs (object, array or string, boolean, number and null values). In the example above, the result is a JSON string token, including the quotes.

using Newtonsoft.Json.Linq;

System.Diagnostics.Debug.Assert(result == "\"bar\"");

var token = JToken.Parse(result);
var text = token.ToString();

System.Diagnostics.Debug.Assert(text == "bar");