Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: Cannot provide value for the missing parameter #6518

Open
MartinM85 opened this issue Dec 14, 2024 · 3 comments · May be fixed by #6520
Open

Bug report: Cannot provide value for the missing parameter #6518

MartinM85 opened this issue Dec 14, 2024 · 3 comments · May be fixed by #6520

Comments

@MartinM85
Copy link
Contributor

Priority

(Low) Something is a little off

Description

Let's say I have a command with one boolean parameter

const options = globalOptionsZod
  .extend({
    enabled: zod.alias('e', z.boolean())
  })
  .strict();

When running the command without the parameter, CLI asks me to provide a value for the parameter

🌶️  Provide values for the following parameters:
√ enabled:  1

But it doesn't accept any value like 0, 1, true, or false and it fails with the error

Error: enabled: Expected boolean, received string

Steps to reproduce

Define zod schema with one boolean parameter for a command and try to run execute the command without the parameter.

Expected results

CLI accepts provided value for missing parameter.

Actual results

Error: enabled: Expected boolean, received string

Diagnostics

No response

CLI for Microsoft 365 version

v10.2.0

nodejs version

v20.8.1

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

No response

Additional Info

No response

@MartinM85 MartinM85 added the bug label Dec 14, 2024
@waldekmastykarz
Copy link
Member

Ouch, thanks for bringing this up. Let's check our logic to find out what's wrong.

@waldekmastykarz
Copy link
Member

@MartinM85 are you btw looking at a specific command that this bug affects or is it a theoretical situation that you came across?

@MartinM85
Copy link
Contributor Author

I found the bug while testing new command: #6519

waldekmastykarz added a commit to waldekmastykarz/cli-microsoft365 that referenced this issue Dec 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants