I’d probably define multiple contracts and have something decide which one should be used. I’d also use an external schema first to check if the basic requirements of the input are met.
This is basically how I ended up doing this. My transaction first validates base contract, fetches another contract depending on the base contract values, validates again and merges errors. It is not the prettiest code to write - unless there is a way to easily merge two or more validation results into one result?