-1

We have a string that is JSON {"value":1} that we need to convert to a Manatee.Json.JsonValue.

Using new JsonValue(value) returns "{\"value\":1}" but we are looking for an actual JSON value of {"value":1}.

We have toyed with JsonObject, and it is possible by converting our JSON to a dictionary, but it would be nice if there is an easier way.

gregsdennis
  • 7,218
  • 3
  • 38
  • 71
deadflowers
  • 63
  • 1
  • 13

1 Answers1

1

I think you need JsonValue.Parse().

From there you can get a JsonObject from the .Object property. JsonObject is derived from Dictionary<string, JsonValue> so you should be able to do that conversation simply.

The documentation is linked on the GitHub readme at the top.

gregsdennis
  • 7,218
  • 3
  • 38
  • 71
  • I swear I tried this earlier but I must have gotten confused, now I'm embarrassed that it's this easy. Thanks so much! – deadflowers Aug 07 '20 at 22:17