requiredIf and isOptional is handled with same structure