Hi, I need help parsing a JSON payload of the form:
[
{ "key": "a", "val": "1" },
{ "key": "b", "val": "2" }
]
into a Dict{Symbol, String} using typed materialization.
I tried:
- Wrapping the Dict in a struct (
Metadata) and using StructUtils.make
- I tried various simmilar things but can't quite make out how to interpret the errors like: ERROR: TypeError: in typeassert, expected Metadata, got a value of type Pair{Symbol, String}
metadata::Dict{Symbol, String} &(json=(lower=lowerMetadata, lift=liftMetadata))
- Got this error: MethodError: Cannot
convert an object of type JSON.Object{String, Any} to an object of type String
What is the correct way to use StructUtils.jl/JSON.jl in this case?