Josh
Josh

Reputation: 598

Thoth.Json get result

Should be nice simple one.

I parse some JSON with Thoth.Json.Net

let children = Decode.Auto.fromString<floorplan_table>(parentTable.mergedchildren)

Which returns a Result

Result<floorplan_table, string>

How do I actually access the floorplan_table and it's key/values?

Upvotes: 1

Views: 105

Answers (1)

Brian Berns
Brian Berns

Reputation: 17038

This will give you access to the floorplan_table inside the Result:

match children with
    | Ok floorplan -> doSomethingWith floorplan
    | Error msg -> handleError msg

Upvotes: 2

Related Questions