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

no method matching JSON3.read(::Cmd, ::Type) #251

Open
eugene-shvarts opened this issue Jan 19, 2023 · 2 comments
Open

no method matching JSON3.read(::Cmd, ::Type) #251

eugene-shvarts opened this issue Jan 19, 2023 · 2 comments

Comments

@eugene-shvarts
Copy link
Contributor

It looks like JSON3.read(cmd::Cmd) just does JSON3.read(Base.read(cmd, String)), but an oversight is that
JSON3.read(cmd::Cmd, sometype::Type) doesn't yield JSON3.read(Base.read(cmd, String), sometype). This is an oversight and a one line fix with a new dispatch, right?

Currently:

julia> JSON3.read(`echo '"hello"'`)
"hello"

julia> JSON3.read(`echo '"hello"'`, String)
ERROR: MethodError: no method matching read(::Cmd, ::Type{String})
@quinnj
Copy link
Owner

quinnj commented Jan 20, 2023

Good catch! Mind making a PR to fix?

@eugene-shvarts
Copy link
Contributor Author

@quinnj done!

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

2 participants