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

unable to parse json array #34

Closed
Iss-in opened this issue Sep 30, 2021 · 4 comments
Closed

unable to parse json array #34

Iss-in opened this issue Sep 30, 2021 · 4 comments
Labels
question Further information is requested

Comments

@Iss-in
Copy link

Iss-in commented Sep 30, 2021

On pulling a json file which contains a json array , I'm getting

error parsing JSON file: sample with Message: json: cannot unmarshal array into Go value of type     map[string]interface {}

Even when expand-json is set to false.
It is supposed to parse json with key value pair only ?

@fabiomsouto
Copy link
Contributor

Hey @Iss-in ,

Can you share an example of a JSON that's causing this issue?

Thanks.

@fabiomsouto fabiomsouto added the question Further information is requested label Oct 14, 2021
@Iss-in
Copy link
Author

Iss-in commented Oct 14, 2021

any json array is causing this error

 [ {a1:b1} ,{a1:b2} ]  is not being parsed

while

{ key : [ {a1:b1} ,{a1:b2} ] } works fine

@fabiomsouto
Copy link
Contributor

@Iss-in that looks right. A map[string]interface{} unmarshalling operation expects an object with keys and values.

@fabiomsouto
Copy link
Contributor

To summarise, what's expected is indeed are JSON files containing an object composed of keys and values.
I'm closing this as it's not an issue. Feel free to reach back if you have any additional questions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Development

No branches or pull requests

2 participants