Home > front end >  json: cannot unmarshal object into Go value of type []interface {}
json: cannot unmarshal object into Go value of type []interface {}

Time:03-15

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

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

CodePudding user response:

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

  • Related