Repository navigation
fix(api): refuse an empty required argument before sending - #3353
Merged
Merged
Conversation
A generated api command sent a required flag given as "" or spaces: `linear api issue-delete --id "" --yes` reached Linear and answered exit 14 outcome.unknown. Commander's mandatory check only rejects a missing flag, and graphqlVariables only rejected null. Now a required parameter (flag, path, query, header) or a required GraphQL variable from --body that is blank is refused with validation_error (exit 2, input.invalid), naming the flag, and nothing is sent. serviceApiWriter refuses the same for code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Telegram's setWebhook takes an empty required url to remove the hook, so the blank check covers path, query and header parameters; GraphQL variables are checked in graphqlVariables. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Task
linear live api issue-delete --id "" --yes --jsonsent the request. It answered exit 14outcome.unknown("Linear did not confirm a write"). A required argument that is empty must be refused locally before any request, with exit 2input.invalid, naming the flag. OpenAPI CLIs must behave the same.What
generatedApiCommandrefuses a required path, query or header parameter that is empty or only spaces, before anything is sent. It answersvalidation_error, which is exit 2 with reasoninput.invalid, and the details saysent: false. On OpenAPI an empty path segment could reach another endpoint (/posts/).graphqlVariablestreats a blank required variable as missing, from a flag or from--body. This covers the command andserviceApiWriter.serviceApiWriterrefuses a blank required path, query or header parameter from code too.setWebhook --url ""as the way to remove a webhook, and tg-cli marksurlas required. The review found this.issue-create --input '{}'gives exit 2 and namesinput.teamId.changes/fix-api-empty-required.md.Testing
--id "",--id " "and--body '{"id":""}'each give exit 2 and name--id, and nothing is sent.src/cli/service-api*,src/cli/botandsrc/paritypass.pnpm ci:quick,pnpm lintandpnpm docs:checkpass.release/1.0against a local pack in a temp worktree with throwaway config folders and no sign-in.linear live api issue-delete --id "" --yes --jsonnow prints{"error":{"code":"validation_error","reason":"input.invalid","message":"issue-delete needs --id","details":{"sent":false}}}with exit 2.The companion cli-base PR is WireCatLabs/cli-base#726 (api skill groups by entity).
🤖 Generated with Claude Code