jehiah / json2csv

command line tool to convert json to csv
MIT License
802 stars 94 forks source link

JSON which is an array #40

Open kirkins opened 4 years ago

kirkins commented 4 years ago

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/

joacole commented 4 years ago

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

kirkins commented 4 years ago

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

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

joacole commented 4 years ago

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