Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

json: cannot unmarshal object into Go value of type []interface {}

I am using krakend and local nodejs server.

As per :
Using KrakenD with local nodejs server

I have created the krakend and nodejs server. It is up and Running and the communication between krakend and nodejs server is properly going on. But, the api response is JSON and while giving response krakend printing

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

2022/03/15 02:54:06 KRAKEND ERROR: [ENDPOINT: /contacts] json: cannot unmarshal object into Go value of type []interface {}

Although I have already added the flag is_collection: "true" in krankend (as shown here)
https://github.com/luraproject/lura/issues/216

But still it is throwing the same error

>Solution :

I am able to get it done via removing the flag

"is_collection": "true",

and instead add the flag

"encoding": "json"

I don’t know what is the issue while parsing the response type but I guess it an issue with Go build or something else

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading