Conditional Validation in Structs Based on Discriminated Union

Is there a way to conditionally validate a struct, based on a discriminated union?

How would I achieve the validation for prefix only if enabled: true?
CleanShot_2024-10-06_at_13.00.18.png
Was this page helpful?