Skip to content

fix: support file and stdin JSON inputs#344

Draft
GannonSun wants to merge 1 commit intolarksuite:mainfrom
GannonSun:codex/fix-windows-structured-input
Draft

fix: support file and stdin JSON inputs#344
GannonSun wants to merge 1 commit intolarksuite:mainfrom
GannonSun:codex/fix-windows-structured-input

Conversation

@GannonSun
Copy link
Copy Markdown

Summary

  • support --params @file.json and --params - for the raw api command and generated service commands
  • support --data @file.json and --data - on the same paths
  • centralize structured JSON input resolution, update help text, and add coverage for file/stdin inputs

Why

On Windows PowerShell, inline JSON like --params '{"foo":"bar"}' can reach native executables with the inner double quotes stripped, so the CLI receives {foo:bar} instead of valid JSON.

That means the failure happens before request construction, and the CLI cannot reliably reconstruct the lost quoting. This change takes the smallest reliable path by adding deterministic cross-platform alternatives: @file and stdin (-).

Validation

  • go test ./internal/cmdutil ./cmd/api ./cmd/service
  • go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.1.6 run --new-from-rev=origin/main

Notes

  • go test -race -gcflags="all=-N -l" -count=1 ./cmd/... ./internal/... ./shortcuts/... could not be run in this Windows environment because gcc/cgo is not installed.
  • A broader go test -count=1 ./cmd/... ./internal/... ./shortcuts/... run on Windows hit existing unrelated failures in packages such as cmd/auth, internal/validate, and shortcuts/mail/draft.

Refs #64

@github-actions github-actions bot added the size/L Large or sensitive change across domains or core paths label Apr 8, 2026
@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 8, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9414b55-8cf0-4fae-a4cd-d4425e02ed81

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Large or sensitive change across domains or core paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants