You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When rtk curl filters JSON API responses, the output has unquoted object keys, producing invalid JSON that breaks downstream parsers (python3 -c 'json.load(...)', jq, etc.).
Reproduction
# With rtk:
rtk curl -s https://any-api.example/endpoint | python3 -c 'import sys,json; json.load(sys.stdin)'# => JSONDecodeError: Expecting property name enclosed in double quotes# Without rtk (works fine):
rtk proxy curl -s https://any-api.example/endpoint | python3 -c 'import sys,json; json.load(sys.stdin)'# => OK
Expected vs Actual
Expected (valid JSON):
{"id": 123, "status": "open"}
Actual (invalid — keys unquoted):
{id: 123, status: "open"}
Root Cause
In src/cmds/system/json_cmd.rs, the extract_schema() function formats object keys without wrapping them in double quotes:
rtk curl no longer rewrites JSON responses into a schema view: PR #1310 removed that conversion in v0.37.2, and PR #1602 (v0.39.0) passes JSON bodies through unchanged. A nested JSON response through rtk curl -s now comes out byte-identical to curl's own output and parses with json.load, piped or in a terminal. If you still get unquoted keys on the latest release, please comment or reopen with the command you ran.
Activity
fix(curl): preserve valid JSON output for piping (#1015)
pszymkowiak commentedon Apr 4, 2026
🔍 Automated Triage
bughighSummary
JSON output from
rtk curlproduces invalid JSON with unquoted object keys; fix is identified and a PR (#1023) is already in progress.📁 Relevant files
src/cmds/system/json_cmd.rssrc/cmds/system/curl_cmd.rsTriaged automatically by wshm · This is an automated analysis, not a human review.
fix(json): quote object keys in extract_schema and compact_json output
fix(json): quote object keys in extract_schema and compact_json output
docs: add CHANGELOG entry for json key quoting fix
KuSh commentedon Nov 23, 2026
rtk curlno longer rewrites JSON responses into a schema view: PR #1310 removed that conversion in v0.37.2, and PR #1602 (v0.39.0) passes JSON bodies through unchanged. A nested JSON response throughrtk curl -snow comes out byte-identical to curl's own output and parses with json.load, piped or in a terminal. If you still get unquoted keys on the latest release, please comment or reopen with the command you ran.