Repository navigation
fix(curl): preserve valid JSON output for piping (#1015) - #1016
pszymkowiak wants to merge 1 commit into
Conversation
curl filter was converting JSON values to type names (extract_schema), producing invalid output that broke downstream JSON parsers (python, jq). Changes: - curl_cmd: pass JSON through unchanged instead of schema transform - json_cmd: quote object keys in extract_schema for valid JSON output - Added tests for JSON validity and quoted keys
|
Closing in favor of #1602, which addresses the same underlying problem (#1536 — #1602 keeps the spirit of the JSON-passthrough idea here, adds an The |
Summary
Problem
rtk curl https://api.example/endpoint | python3 -c 'json.load(sys.stdin)'failed because:extract_schema()replaced values with type names (int,string,bool){name: string}instead of{"name": "string"})Fix
curl_cmd: JSON responses pass through unchanged (no schema transform)json_cmd: keys are now double-quoted inextract_schema()for other consumersTest plan
cargo test curl_cmd— 4 tests passcargo test json_cmd— 9 tests passrtk curl <api> | python3 -c 'json.load(...)'works