Opened from failing KB functional tests in test/functional/kb/definitions/. Non-JSON responses are parsed as JSON under --json. Endpoints returning YAML (GET .../download) or NDJSON (export_list_items) trigger client-side parse errors (Unexpected non-whitespace character after JSON), so the test fails on an unparseable response.
Respect the response content-type (or the endpoint's declared x-response-type) and pass through text/NDJSON bodies instead of calling JSON.parse. Add a unit test with a text/yaml and an application/x-ndjson response asserting the raw body is returned and exit code is 0.
Failing test definitions:
elastic_agent_policies_get_fleet_kubernetes_download.yml (stack + serverless)
security_lists_api_export_list_items.yml (stack)
Opened from failing KB functional tests in
test/functional/kb/definitions/. Non-JSON responses are parsed as JSON under--json. Endpoints returning YAML (GET .../download) or NDJSON (export_list_items) trigger client-side parse errors (Unexpected non-whitespace character after JSON), so the test fails on an unparseable response.Respect the response
content-type(or the endpoint's declaredx-response-type) and pass through text/NDJSON bodies instead of callingJSON.parse. Add a unit test with atext/yamland anapplication/x-ndjsonresponse asserting the raw body is returned and exit code is 0.Failing test definitions:
elastic_agent_policies_get_fleet_kubernetes_download.yml(stack + serverless)security_lists_api_export_list_items.yml(stack)