Skip to content

Add --no-x flag counterpart for bool query params - #13

Open
dm1tryG wants to merge 1 commit into
mainfrom
fix/issue-7-bool-flags
Open

Add --no-x flag counterpart for bool query params#13
dm1tryG wants to merge 1 commit into
mainfrom
fix/issue-7-bool-flags

Conversation

@dm1tryG

@dm1tryG dm1tryG commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Bool query params now render as typer.Option(default, "--name/--no-name", ...) instead of a single --name flag, so callers can explicitly pass false (previously only --name existed and there was no way to set false explicitly).

Test plan

  • uv run pytest — 32 passed
  • New tests confirm the generated flag pair syntax and that Typer parses --no-done without a "No such option" error
  • Manually verified with a standalone typer script that --done/--no-done with None default correctly yields True/False/None

Closes #7

Typer does not auto-generate a --no-x flag when the option name is
given explicitly as a string, so a bool query param like --done had
no way to send an explicit false. Now bool params render as
"--name/--no-name" flag pairs so both true and false are reachable
from the CLI.

Closes #7
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.

Bool query/body parameters cannot be explicitly set to false

1 participant