I'd like to propose that we research the viability of using zod for validating options. While originally we only had required and optional options, later we introduced option sets. Yet, it seems like we're missing some scenarios (#5636 and #5637). What's more, our validation of options is split into a few parts: required/optional, optionsets, and the actual values and types.
Using a package like zod would allow us centralize all validation rules in a single schema, covering all aspects for each option. Let's do a PoC to see if it would help us. Refactoring would mean a significant effort so let's give it a good though before we commit to it.
I'd like to propose that we research the viability of using zod for validating options. While originally we only had required and optional options, later we introduced option sets. Yet, it seems like we're missing some scenarios (#5636 and #5637). What's more, our validation of options is split into a few parts: required/optional, optionsets, and the actual values and types.
Using a package like zod would allow us centralize all validation rules in a single schema, covering all aspects for each option. Let's do a PoC to see if it would help us. Refactoring would mean a significant effort so let's give it a good though before we commit to it.