json2csv icon indicating copy to clipboard operation
json2csv copied to clipboard

JSON which is an array

Open kirkins opened this issue 4 years ago • 3 comments

Trying to convert JSON which is an array rather than a single object and I get back the following error:

ERROR Decoding JSON at line 1: json: cannot unmarshal array into Go value of type map[string]interface {}

Source of data https://pressbooks.online.ucf.edu/wp-json/pressbooks/v2/books/

kirkins avatar Mar 01 '20 15:03 kirkins

I'm having this issue as well. Any ideas how to fix it? Thanks!

joacole avatar Mar 23 '20 20:03 joacole

@joacole in my case I used a custom jq command instead

https://unix.stackexchange.com/q/570548/16792

kirkins avatar Mar 23 '20 20:03 kirkins

@kirkins Thanks. I think I'm going to have to do that as well until this is fixed.

joacole avatar Mar 23 '20 20:03 joacole