KrakenD returns empty response for collection endpoint
akvasof opened this issue · comments
Alexander Kvasov commented
I have the backend returns next json collection response in Postman:
then I have next config:
{
"endpoint": "/products",
"method": "GET",
"output_encoding": "json-collection",
"input_headers": ["*"]
"backend":
{
"url_pattern": "/api/products?status=5",
"method": "GET",
"encoding": "<no value>",
"is_collection": "true",
"host": "https://...",
"extra_config": {
"backend/http": {
"return_error_code": true
}
,"proxy": {"flatmap_filter":[{"args":["productGroups"],"type":"del"}]}
}
}
}
and this endpoint always returns empty result:
Could someone explain what I'm doing wrong?
I spent lot of time to read docs and google and play with different parameters but without luck.
If I use "output_encoding": "no-op" everything work fine, but then ,"proxy": {"flatmap_filter":[{"args":["productGroups"],"type":"del"}]} doesn't work as per design.
Service config part is:
{
"port": 4000,
"name": "KrakenD development",
"environment": "DEVELOPMENT",
"default_host": "http://localhost:4000",
"timeout": "2000s",
"cache_ttl": "3s",
"debug_endpoint": true,
"echo_endpoint": true,
"plugin": {
"pattern": ".so",
"folder": "/opt/krakend/plugins/"
},
"extra_config": {
"telemetry/logging": {
"level": "DEBUG",
"prefix": "[KRAKEND]",
"syslog": false,
"stdout": true
},
"router": {
"return_error_msg": true
},
"telemetry/metrics": {
"collection_time": "60s",
"proxy_disabled": false,
"router_disabled": false,
"backend_disabled": false,
"endpoint_disabled": false,
"listen_address": ":8090"
}
}
}