Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Allow specification of full dictionary type #340

Open
jakewilliami opened this issue Apr 24, 2022 · 0 comments
Open

Feature: Allow specification of full dictionary type #340

jakewilliami opened this issue Apr 24, 2022 · 0 comments

Comments

@jakewilliami
Copy link

I understand that the dicttype keyword argument allows one to specify the general dictionary in which the JSON object is stored when it is read/parsed. However, I think a outtype argument could be specified so that not all JSON reads as Dict{T, Any}. For example:

julia> s = raw"""{"a", {"b", ["c", "d", "e"]}}""";

julia> JSON.parse(s, outtype=Dict{String, Dict{String, Vector{String}}})
Dict{String, Dict{String, Vector{String}}} with 1 entry:
  "a" => Dict("b"=>["c", "d", "e"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant