Skip to content

fix: reject blanks for required path params - #141

Open
sapihav wants to merge 1 commit into
elevenlabs:mainfrom
sapihav:fix/validate-required-path-values
Open

fix: reject blanks for required path params#141
sapihav wants to merge 1 commit into
elevenlabs:mainfrom
sapihav:fix/validate-required-path-values

Conversation

@sapihav

@sapihav sapihav commented Sep 5, 2026

Copy link
Copy Markdown

fair disclaimer: fix vibed with Astra, but reviewed and verified manually

Problem

ElevenLabs CLI v1.1.0 accepts an empty value for the required voice_id path parameter. It then sends the request to /v1/text-to-speech/, which returns a misleading Not Found instead of a local validation error.

Observed on macOS, Apple Silicon.

Reproduction

No credentials or API request are needed:

elevenlabs text-to-speech convert \
  --dry-run \
  --voice-id '' \
  --model-id eleven_flash_v2_5 \
  --text "Hello"

Before this change, the dry run succeeds and includes:

{
  "method": "POST",
  "url": "https://api.elevenlabs.io/v1/text-to-speech/"
}

Without --dry-run, the API returns:

error[api]: Not Found

A dry run does not contact the API or create an audio file; the bug is that it accepts the invalid path value.

After this change, the same command exits with code 3 and reports:

Required path parameter 'voice_id' is empty. Provide it via --voice-id or --params

Fix and verification

Add is_blank_path_value into validation loops


Before

Знімок екрана 2026-09-05 о 16 59 34 Знімок екрана 2026-09-05 о 17 05 12 Знімок екрана 2026-09-05 о 17 03 18

After

Знімок екрана 2026-09-05 о 17 08 19

Reject empty strings, whitespace-only strings and null before URL
construction. Preserve ordered errors, global fallback and optional
parameter behavior. Cover validation and overrides with 27 test cases.
@sapihav sapihav changed the title fix: reject blank required path parameters fix: reject blanks for required path params Sep 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant