Help with JSON2.jl

What am I doing wrong here? I get ERROR: MethodError: no method matching nQ

julia> mutable struct Q
           name::String
           scens::Vector{String}                               
           nQ(name, scens) = new(name,scens) 
       end

julia> q1 = """{
                   "name": "q1",
                   "scens": ["M00000001"]
               }"""

julia> JSON2.read(q1, Q)
ERROR: MethodError: no method matching Q(::String, ::Array{String,1})

remove this line or change nQ into Q

thanks, that was a typo from reducing my issue… I will add the rest of the properties

Okay here is the full version (and thanks for looking)

using JSON2

struct ClientSortBy
    colName::String
    revDir::Int32 # 0 asc 1 desc
    ClientSortBy(colName::String, revDir::Int32) = new(colName,revDir)
    ClientSortBy(d::Dict{String, Any}) = new(d["colName"], d["revDir"])
end

struct ClientFilter
    colName::String
    colAttr::String
    ClientFilter(colName::String, colAttr::String) = new(colName,colAttr)
    ClientFilter(d::Dict{String, Any}) = new(d["colName"], d["colAttr"])
end

mutable struct ClientnQ
    name::String
    scens::Vector{String}
    joinScens::Vector{String}
    filters::Vector{Vector{ClientFilter}}
    groupBy::Vector{Vector{String}}
    msrs::Vector{String}
    joinMsrs::Vector{String}
    sortBy::Vector{ClientSortBy}
    ClientnQ(name,scens,joinScens,filters,groupBy,msrs,joinMsrs,sortBy) =
        new(name,scens,joinScens,map(f->map(i->ClientFilter(i["colName"],i["colAttr"]),f),filters),groupBy,msrs,joinMsrs,map(s->ClientSortBy(s["colName"],s["revDir"]),sortBy))
end

q1 = """{
            "name": "q1",
            "scens": ["M00000001"],
            "joinScens": [],
            "filters": [[{"colName": "ENC_TYPE", "colAttr": "Inpatient"}]],
            "groupBy":[["PAT_CLASS"],[]],
            "msrs":["NET_REVENUE"],
            "joinMsrs":[],
            "sortBy":[{ "colName": "PAT_CLASS", "revDir":0}]
        }"""

JSON2.read(q1,ClientnQ)

I get " ERROR: MethodError: no method matching getindex(::ClientFilter, ::String)"

never mind … the whole point of JSON2 was that is attempt to constructs the type … so this was not needed : map(f->map(i->ClientFilter(i[“colName”],i[“colAttr”]),f),filters)