krakend / krakend-ce

KrakenD Community Edition: High-performance, stateless, declarative, API Gateway written in Go.

Home Page:https://www.krakend.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

KrakenD returns empty response for collection endpoint

akvasof opened this issue · comments

I have the backend returns next json collection response in Postman:

image

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:
image

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"
	  }
	}
 }