Description
When using aspire resource with named command options, validation of choice inputs does not work correctly for dependent choices.
If an invalid choice is given for a preloaded choice, it fails with a good error message. But if the same thing is done for a dependent choice (one that loads its values when a prior input is set), the invalid value is allowed through without validation.
The CLI should validate dependent choice values against their allowed options, just like it does for preloaded choices.
Steps to reproduce
- Run a resource command that has a dependent choice input (a choice whose allowed values are loaded based on a prior input value)
- Provide an invalid value for the dependent choice
- Observe that the invalid value is accepted instead of being rejected
Expected behavior
The CLI should reject invalid values for dependent choice inputs and display an error message listing the allowed values, consistent with how preloaded choice validation works.
Actual behavior
Invalid values for dependent choice inputs are silently accepted and sent to the resource command.
From #16903 (comment)
Description
When using
aspire resourcewith named command options, validation of choice inputs does not work correctly for dependent choices.If an invalid choice is given for a preloaded choice, it fails with a good error message. But if the same thing is done for a dependent choice (one that loads its values when a prior input is set), the invalid value is allowed through without validation.
The CLI should validate dependent choice values against their allowed options, just like it does for preloaded choices.
Steps to reproduce
Expected behavior
The CLI should reject invalid values for dependent choice inputs and display an error message listing the allowed values, consistent with how preloaded choice validation works.
Actual behavior
Invalid values for dependent choice inputs are silently accepted and sent to the resource command.
From #16903 (comment)