func (in *Stressors) Validate(root interface{}, path *field.Path) field.ErrorList {
	if in == nil {
		return nil
	}
	if in.MemoryStressor == nil && in.CPUStressor == nil {
		return field.ErrorList{
			field.Invalid(path, in, "missing stressors"),
		}
	}
	return nil
}
Validate validates whether the Stressors are all well defined
package v1alpha1
import (
	"errors"
	"fmt"
	"reflect"
	"strconv"
	"github.com/docker/go-units"
	"k8s.io/apimachinery/pkg/util/validation/field"
	"github.com/chaos-mesh/chaos-mesh/api/v1alpha1/genericwebhook"
)
func (in *StressChaosSpec) Validate(root interface{}, path *field.Path) field.ErrorList {
	if len(in.StressngStressors) == 0 && in.Stressors == nil {
		return field.ErrorList{
			field.Invalid(path, in, "missing stressors"),
		}
	}
	return nil
}