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

Cannot validate multiple required Option #1150

Open
libe opened this issue Nov 21, 2024 · 0 comments
Open

Cannot validate multiple required Option #1150

libe opened this issue Nov 21, 2024 · 0 comments
Labels
status/need-triage Team needs to triage and take a first look

Comments

@libe
Copy link

libe commented Nov 21, 2024

I am having trouble validating multiple required Option, here's my example:

@Command(command = "dataset", group = "Dataset Commands")
class DatasetCommands {
    @Command(command = "describe", description = "Describe a dataset by id")
    String findById(@Option(required = true, description = "Project id") String projectId, 
                    @Option(required = true, description = "Dataset id") String datasetId)  {
        return String.format("Got projectId %s datasetId %s", projectId, datasetId);
    }
}

So I launch the command with

dataset describe 1

I get

Got projectId 1 datasetId null

I would have expected to get something like "not all options are passed" exception but strange the command is executed with the second option null.

Any idea if I am doing something wrong?

Thanks in advance!

@github-actions github-actions bot added the status/need-triage Team needs to triage and take a first look label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/need-triage Team needs to triage and take a first look
Projects
None yet
Development

No branches or pull requests

1 participant